#define RUN_LED_OFF GPIOA->BSRRH = GPIO_Pin_15
用BSRRL和BSRRH 指令试下;
/*
*********************************************************************************************************
判断现在的灯是亮的还是灭的
*********************************************************************************************************
*/
uint8_t bsp_IsLedOn(uint8_t _no)
{
if (_no == 1)
{
if ((GPIO_PORT_LED1->ODR & GPIO_PIN_LED1) == 0)
{
return 1;
}
return 0;
}
}
、、=================================================================================
/*
*********************************************************************************************************
翻转led灯
*********************************************************************************************************
*/
void bsp_LedToggle(uint8_t _no)
{
if (_no == 1)
{
GPIO_PORT_LED1->ODR ^= GPIO_PIN_LED1;
}
、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
#define I2C_SDA_READ() ((GPIO_PORT_I2C->IDR & I2C_SDA_PIN) != 0)/* 读口状态*/