2025-02-19 13:21:11 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, SHANGHAI FUDAN MICROELECTRONICS GROUP CO., LTD.(FUDAN MICROELECTRONICS./ FUDAN MICRO.)
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Processor: FM33LG0xxA
|
|
|
|
* http: http://www.fmdevelopers.com.cn/
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
|
|
* and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* 4. To provide the most up-to-date information, the revision of our documents
|
|
|
|
* on the World Wide Web will be the most Current. Your printed copy may be
|
|
|
|
* an earlier revision. To verify you have the latest information avaliable,
|
|
|
|
* refer to: http://www.fmdevelopers.com.cn/.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY FUDAN MICRO "AS IS" AND ANY EXPRESSED
|
|
|
|
* ORIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED.IN NO EVENT SHALL FUDAN MICRO OR ITS CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISINGIN ANY WAY OUT OF THE
|
|
|
|
* USE OF THIS SOFTWARE, EVEN IF ADVISED OFTHE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
2025-02-18 10:13:34 +08:00
|
|
|
#ifndef __USER_INIT_H__
|
|
|
|
#define __USER_INIT_H__
|
|
|
|
|
|
|
|
#include "main.h"
|
|
|
|
#ifndef MFANG
|
|
|
|
#include <stdio.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MFANG
|
|
|
|
|
|
|
|
#define LED_ENABLE 0
|
|
|
|
|
|
|
|
#if (LED_ENABLE == 1)
|
|
|
|
#define LED0_GPIO GPIOB
|
|
|
|
#define LED0_PIN FL_GPIO_PIN_9
|
|
|
|
|
|
|
|
#define LED0_ON() FL_GPIO_ResetOutputPin(LED0_GPIO, LED0_PIN)
|
|
|
|
#define LED0_OFF() FL_GPIO_SetOutputPin(LED0_GPIO, LED0_PIN)
|
|
|
|
#define LED0_TOG() LED0_GPIO->DO ^= LED0_PIN
|
|
|
|
|
|
|
|
#define LED1_GPIO GPIOB
|
|
|
|
#define LED1_PIN FL_GPIO_PIN_10
|
|
|
|
|
|
|
|
#define LED1_ON() FL_GPIO_ResetOutputPin(LED1_GPIO, LED1_PIN)
|
|
|
|
#define LED1_OFF() FL_GPIO_SetOutputPin(LED1_GPIO, LED1_PIN)
|
|
|
|
#define LED1_TOG() LED1_GPIO->DO ^= LED1_PIN
|
|
|
|
|
|
|
|
#define LED2_GPIO GPIOB
|
|
|
|
#define LED2_PIN FL_GPIO_PIN_11
|
|
|
|
|
|
|
|
#define LED2_ON() FL_GPIO_ResetOutputPin(LED2_GPIO, LED2_PIN)
|
|
|
|
#define LED2_OFF() FL_GPIO_SetOutputPin(LED2_GPIO, LED2_PIN)
|
|
|
|
#define LED2_TOG() LED2_GPIO->DO ^= LED2_PIN
|
|
|
|
|
|
|
|
#define LED3_GPIO GPIOB
|
|
|
|
#define LED3_PIN FL_GPIO_PIN_12
|
|
|
|
|
|
|
|
#define LED3_ON() FL_GPIO_ResetOutputPin(LED3_GPIO, LED3_PIN)
|
|
|
|
#define LED3_OFF() FL_GPIO_SetOutputPin(LED3_GPIO, LED3_PIN)
|
|
|
|
#define LED3_TOG() LED3_GPIO->DO ^= LED3_PIN
|
|
|
|
|
|
|
|
#define LED_R_GPIO GPIOB
|
|
|
|
#define LED_R_PIN FL_GPIO_PIN_5
|
|
|
|
|
|
|
|
#define LED_R_ON() FL_GPIO_ResetOutputPin(LED_R_GPIO, LED_R_PIN)
|
|
|
|
#define LED_R_OFF() FL_GPIO_SetOutputPin(LED_R_GPIO, LED_R_PIN)
|
|
|
|
#define LED_R_TOG() LED_R_GPIO->DO ^= LED_R_PIN
|
|
|
|
|
|
|
|
#define LED_G_GPIO GPIOB
|
|
|
|
#define LED_G_PIN FL_GPIO_PIN_6
|
|
|
|
|
|
|
|
#define LED_G_ON() FL_GPIO_ResetOutputPin(LED_G_GPIO, LED_G_PIN)
|
|
|
|
#define LED_G_OFF() FL_GPIO_SetOutputPin(LED_G_GPIO, LED_G_PIN)
|
|
|
|
#define LED_G_TOG() LED_G_GPIO->DO ^= LED_G_PIN
|
|
|
|
|
|
|
|
#define LED_B_GPIO GPIOB
|
|
|
|
#define LED_B_PIN FL_GPIO_PIN_4
|
|
|
|
|
|
|
|
#define LED_B_ON() FL_GPIO_ResetOutputPin(LED_B_GPIO, LED_B_PIN)
|
|
|
|
#define LED_B_OFF() FL_GPIO_SetOutputPin(LED_B_GPIO, LED_B_PIN)
|
|
|
|
#define LED_B_TOG() LED_B_GPIO->DO ^= LED_B_PIN
|
|
|
|
#else
|
|
|
|
#define LED0_GPIO GPIOB
|
2025-02-19 13:21:11 +08:00
|
|
|
#define LED0_PIN FL_GPIO_PIN_11
|
2025-02-18 10:13:34 +08:00
|
|
|
|
|
|
|
#define LED0_ON() FL_GPIO_ResetOutputPin(LED0_GPIO, LED0_PIN)
|
|
|
|
#define LED0_OFF() FL_GPIO_SetOutputPin(LED0_GPIO, LED0_PIN)
|
2025-02-19 13:21:11 +08:00
|
|
|
#define LED0_TOG() FL_GPIO_ToggleOutputPin(LED0_GPIO, LED0_PIN)
|
2025-02-18 10:13:34 +08:00
|
|
|
|
|
|
|
#define LED1_GPIO GPIOB
|
2025-02-19 13:21:11 +08:00
|
|
|
#define LED1_PIN FL_GPIO_PIN_9
|
2025-02-18 10:13:34 +08:00
|
|
|
|
|
|
|
#define LED1_ON() FL_GPIO_ResetOutputPin(LED1_GPIO, LED1_PIN)
|
|
|
|
#define LED1_OFF() FL_GPIO_SetOutputPin(LED1_GPIO, LED1_PIN)
|
2025-02-19 13:21:11 +08:00
|
|
|
#define LED1_TOG() FL_GPIO_ToggleOutputPin(LED1_GPIO, LED1_PIN)
|
2025-02-18 10:13:34 +08:00
|
|
|
|
|
|
|
#define LED2_GPIO GPIOB
|
|
|
|
#define LED2_PIN FL_GPIO_PIN_10
|
|
|
|
|
|
|
|
#define LED2_ON() FL_GPIO_ResetOutputPin(LED2_GPIO, LED2_PIN)
|
|
|
|
#define LED2_OFF() FL_GPIO_SetOutputPin(LED2_GPIO, LED2_PIN)
|
|
|
|
#define LED2_TOG()
|
|
|
|
|
2025-02-19 13:21:11 +08:00
|
|
|
#define LED3_GPIO GPIOC
|
|
|
|
#define LED3_PIN FL_GPIO_PIN_8
|
2025-02-18 10:13:34 +08:00
|
|
|
|
|
|
|
#define LED3_ON() FL_GPIO_ResetOutputPin(LED3_GPIO, LED3_PIN)
|
|
|
|
#define LED3_OFF() FL_GPIO_SetOutputPin(LED3_GPIO, LED3_PIN)
|
|
|
|
#define LED3_TOG()
|
|
|
|
|
|
|
|
#define LED_R_GPIO GPIOB
|
|
|
|
#define LED_R_PIN FL_GPIO_PIN_10
|
|
|
|
|
|
|
|
#define LED_R_ON() FL_GPIO_ResetOutputPin(LED_R_GPIO, LED_R_PIN)
|
|
|
|
#define LED_R_OFF() FL_GPIO_SetOutputPin(LED_R_GPIO, LED_R_PIN)
|
|
|
|
#define LED_R_TOG()
|
|
|
|
|
|
|
|
#define LED_G_GPIO GPIOB
|
|
|
|
#define LED_G_PIN FL_GPIO_PIN_10
|
|
|
|
|
|
|
|
#define LED_G_ON() FL_GPIO_ResetOutputPin(LED_G_GPIO, LED_G_PIN)
|
|
|
|
#define LED_G_OFF() FL_GPIO_SetOutputPin(LED_G_GPIO, LED_G_PIN)
|
|
|
|
#define LED_G_TOG()
|
|
|
|
|
|
|
|
#define LED_B_GPIO GPIOB
|
|
|
|
#define LED_B_PIN FL_GPIO_PIN_10
|
|
|
|
|
|
|
|
#define LED_B_ON() FL_GPIO_ResetOutputPin(LED_B_GPIO, LED_B_PIN)
|
|
|
|
#define LED_B_OFF() FL_GPIO_SetOutputPin(LED_B_GPIO, LED_B_PIN)
|
|
|
|
#define LED_B_TOG()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern struct UARTOpStruct UARTxOp;
|
|
|
|
|
|
|
|
void Close_And_ClearIRQ(IRQn_Type IRQn);
|
|
|
|
void UserInit(void);
|
|
|
|
void FoutInit(void);
|
|
|
|
#endif
|