论坛元老
 
- 积分
- 3293
- 金钱
- 3293
- 注册时间
- 2016-1-7
- 在线时间
- 541 小时
|
5金钱
网上说,STM32L0或STM32L4低功耗的芯片不支持位带操作,而我要表示成PAin(0) 用什么函数可以替代?
///////////////////////////////////////////////////////////////////////////////////////////////////////////
如果是输出的话:PAout(0),
可以用以下替代:
#define PAout(x) do{ x ? \
HAL_GPIO_WritePin(GPIO_PORTA, GPIO_PINA, GPIO_PIN_SET) : \
HAL_GPIO_WritePin(GPIO_PORTA, GPIO_PINA, GPIO_PIN_RESET); \
}while(0)
//////////////////////////////////////////////////////////////////////////////////////////////////////////
而我要表示输入PAin(x) ,这个用什么函数可以替代?哪位大虾帮看下,具体怎么表示。谢谢!!!
|
|