parent
a971c8ccc5
commit
7903659044
|
@ -3,10 +3,15 @@
|
|||
|
||||
#define GPIO_NOAF (0u)
|
||||
#define _PIN_INIT(_PORT, _PIN, _MODE, _PULL, _SPEED, _AF) \
|
||||
HAL_GPIO_Init(GPIO##_PORT, \
|
||||
(GPIO_InitTypeDef[]) { \
|
||||
{.Pin = GPIO_PIN_##_PIN, .Mode = GPIO_##_MODE, .Pull = GPIO_##_PULL, .Speed = GPIO_##_SPEED, .Alternate = GPIO_##_AF}
|
||||
})
|
||||
HAL_GPIO_Init(GPIO##_PORT, (GPIO_InitTypeDef[]) \
|
||||
{{ \
|
||||
.Pin = GPIO_PIN_##_PIN, \
|
||||
.Mode = GPIO_##_MODE, \
|
||||
.Pull = GPIO_##_PULL, \
|
||||
.Speed = GPIO_##_SPEED, \
|
||||
.Alternate = GPIO_##_AF \
|
||||
}})
|
||||
|
||||
#define _PIN_HI(_PORT, _PIN, ...) GPIO##_PORT->BSRR = (1u << _PIN)
|
||||
#define _PIN_LOW(_PORT, _PIN, ...) GPIO##_PORT->BSRR = (0x10000u << _PIN)
|
||||
#define _PIN_TOGGLE(_PORT, _PIN, ...) \
|
||||
|
|
Loading…
Reference in New Issue