простые функции унесла в хэдер, чтобы сделать инлайном
This commit is contained in:
parent
287e66669e
commit
95884860ad
@ -105,9 +105,15 @@ static const uint8_t A7 = PIN_A7;
|
||||
// determines the address of the port by the board pin number to which this pin belongs on the MCU
|
||||
GPIO_TypeDef* digitalPinToPort(uint32_t digPinNumber);
|
||||
// determines the pin address inside the port by the board pin number
|
||||
HAL_PinsTypeDef digitalPinToBitMask(uint32_t digPinNumber);
|
||||
static inline HAL_PinsTypeDef digitalPinToBitMask(uint32_t digitalPinNumber)
|
||||
{
|
||||
return (HAL_PinsTypeDef)(1 << (digitalPinNumber & 0xF));
|
||||
}
|
||||
// total number of pins available for initialization
|
||||
uint16_t pinCommonQty(void);
|
||||
static inline uint16_t pinCommonQty(void)
|
||||
{
|
||||
return (uint16_t)40;
|
||||
}
|
||||
// the function returns a reference to the OUTPUT address of the GPIO register
|
||||
volatile uint32_t* portOutputRegister(GPIO_TypeDef* GPIO_x);
|
||||
// the function returns a reference to the STATE address of the GPIO register
|
||||
|
||||
@ -41,17 +41,6 @@ GPIO_TypeDef *digitalPinToPort(uint32_t digitalPinNumber)
|
||||
}
|
||||
}
|
||||
|
||||
// determines the pin address inside the port by the board pin number
|
||||
HAL_PinsTypeDef digitalPinToBitMask(uint32_t digitalPinNumber)
|
||||
{
|
||||
return 1 << (digitalPinNumber & 0xF);
|
||||
}
|
||||
|
||||
uint16_t pinCommonQty(void)
|
||||
{
|
||||
return (uint16_t)40;
|
||||
}
|
||||
|
||||
// the function returns a reference to the OUTPUT address of the GPIO register
|
||||
volatile uint32_t *portOutputRegister(GPIO_TypeDef *GPIO_x)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user