75 lines
1.5 KiB
C
75 lines
1.5 KiB
C
#ifndef __BSP_H__
|
|
#define __BSP_H__
|
|
|
|
#include "at32f403a_407.h"
|
|
|
|
//
|
|
// USB
|
|
//
|
|
#define T_SEL_Pin GPIO_PINS_13
|
|
#define T_SEL_GPIO_Port GPIOC
|
|
#define S_USB_EN_Pin GPIO_PINS_9
|
|
#define S_USB_EN_GPIO_Port GPIOB
|
|
|
|
//
|
|
// Charge Enable
|
|
//
|
|
#define S_CHARGE_CTRL_Pin GPIO_PINS_1
|
|
#define S_CHARGE_CTRL_GPIO_Port GPIOC
|
|
|
|
//
|
|
// Dream Core Power
|
|
//
|
|
#define P_CORE_PWR_Pin GPIO_PINS_3
|
|
#define P_CORE_PWR_GPIO_Port GPIOC
|
|
|
|
//
|
|
// ADC Select
|
|
//
|
|
#define S_ADDR_S2_Pin GPIO_PINS_3
|
|
#define S_ADDR_S2_GPIO_Port GPIOB
|
|
#define S_ADDR_S1_Pin GPIO_PINS_4
|
|
#define S_ADDR_S1_GPIO_Port GPIOB
|
|
#define S_ADDR_S0_Pin GPIO_PINS_5
|
|
#define S_ADDR_S0_GPIO_Port GPIOB
|
|
|
|
//
|
|
// HT7178 Power Enable
|
|
//
|
|
#define S_HT7178_EN_Pin GPIO_PINS_1
|
|
#define S_HT7178_EN_GPIO_Port GPIOB
|
|
|
|
//
|
|
// Main Power
|
|
//
|
|
#define S_PWR_ON_OFF_Pin GPIO_PINS_2
|
|
#define S_PWR_ON_OFF_GPIO_Port GPIOB
|
|
|
|
//
|
|
// BT Module Power
|
|
//
|
|
#define S_BT_PWR_Pin GPIO_PINS_8
|
|
#define S_BT_PWR_GPIO_Port GPIOB
|
|
|
|
//
|
|
// Power Button
|
|
//
|
|
#define POWER_BUTTON_PIN GPIO_PINS_2
|
|
#define POWER_BUTTON_PORT GPIOD
|
|
|
|
#define S_CHORD_PLUGIN_PIN GPIO_PINS_9
|
|
#define S_CHORD_PLUGIN_PORT GPIOA
|
|
|
|
|
|
extern void BSP_MainPowerEnable (uint8_t Enable);
|
|
extern void BSP_ChargerEnable (uint8_t Enable);
|
|
extern void BSP_DreamCorePowerEnable (uint8_t Enable);
|
|
extern void BSP_HT7178PowerEnable (uint8_t Enable);
|
|
extern void BSP_BlueToothPowerEnable (uint8_t Enable);
|
|
extern void BSP_SelectAdcChannel (uint8_t ChannelId);
|
|
extern flag_status BSP_GetPowerKey (void);
|
|
extern flag_status BSP_GetADCIN1Key (void);
|
|
extern flag_status BSP_GetCHORDState (void);
|
|
|
|
#endif // __BSP_H__
|