/************************************************************************************************* **Filename: mcu_bsp.h **Version : **Author : **Date : **Description: ** *************************************************************************************************/ #ifndef __MCU_CONFIG_H__ #define __MCU_CONFIG_H__ /********************************************************************* * Include (include files) */ #include "ARMCM0.h" #include "gpio.h" /* 输出 LED IO 配置 */ #define LED_PIN GPIO_6 #define LED_ON() GPIO_Pin_Clear(U32BIT(LED_PIN)) #define LED_OFF() GPIO_Pin_Set(U32BIT(LED_PIN)) #define LED_TURN() GPIO_Pin_Turn(U32BIT(LED_PIN)) /* 输出 IIC IO配置 */ //lsm6d IIC IO口 #define I2C0_SCLK GPIO_19 #define I2C0_SDA GPIO_18 //lis2dh IIC IO口 #define I2C1_SCLK GPIO_3 #define I2C1_SDA GPIO_2 /* 控制IO配置 */ #define PEN_PIN GPIO_8 //lsm6d 供电使能控制引脚 #define CS_PIN GPIO_20 //lsm6d 通讯模式控制引脚 #define SA0_PIN GPIO_17 //lsm6d 地址选择控制引脚 #define CEN_PIN GPIO_31 //电池采样控制引脚 #define PEN_DISABLE() GPIO_Pin_Set(U32BIT(PEN_PIN)) #define PEN_ENABLE() GPIO_Pin_Clear(U32BIT(PEN_PIN)) #define CEN_DISABLE() GPIO_Pin_Clear(U32BIT(CEN_PIN)) #define CEN_ENABLE() GPIO_Pin_Set(U32BIT(CEN_PIN)) /* 中断 IO配置 */ #define LIS2D_INT1 GPIO_4 #define LIS2D_INT2 GPIO_5 /* ADC 通道配置 */ #define ADCGP_IO GPIO_30 #define ADCGP_CH ADCGP_CH6 /********************************************************************* * Global Function declared ('extern') */ void BSP_MCU_Config(void); #endif