простые функции унесла в хэдер, чтобы сделать инлайном

This commit is contained in:
KLASSENTS 2025-01-25 09:03:47 +07:00
parent 25bc00a1bd
commit c6c671e7a8
2 changed files with 8 additions and 13 deletions

View File

@ -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 // 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); GPIO_TypeDef* digitalPinToPort(uint32_t digPinNumber);
// determines the pin address inside the port by the board pin number // 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 // 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 // the function returns a reference to the OUTPUT address of the GPIO register
volatile uint32_t* portOutputRegister(GPIO_TypeDef* GPIO_x); volatile uint32_t* portOutputRegister(GPIO_TypeDef* GPIO_x);
// the function returns a reference to the STATE address of the GPIO register // the function returns a reference to the STATE address of the GPIO register

View File

@ -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 // the function returns a reference to the OUTPUT address of the GPIO register
volatile uint32_t *portOutputRegister(GPIO_TypeDef *GPIO_x) volatile uint32_t *portOutputRegister(GPIO_TypeDef *GPIO_x)
{ {