Добавлена библиотека IRremote

1. Инициализация hal библиотек, включение тактирования портов, установка вектора прерываний теперь производится в crt0.S
2. Добавлена библиотека IRremote. Для работы использует прерывание таймера timer16_0
Co-authored-by: KLASSENTS <klassen@elron.tech>
Co-committed-by: KLASSENTS <klassen@elron.tech>
This commit was merged in pull request #10.
This commit is contained in:
klassents authored and klassents committed 2025-01-25 06:52:10 +03:00
1 parent 2945cf9c8c
commit e53bac6ba8
122 files changed
+34285 -29

No files matched your search

+9 -2
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
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
@@ -125,6 +131,7 @@ static inline void additionalPinsInit(uint32_t PinNumber) {}
uint32_t analogInputToChannelNumber(uint32_t PinNumber);
// PWM
#define PWM_FREQUENCY_MAX 1000000 // Hz
bool digitalPinHasPWM(uint8_t p);
bool digitalPinPwmIsOn(uint8_t digitalPin); // use only if digitalPinHasPWM() == true
// determines which timer the pin belongs to
-11
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
volatile uint32_t *portOutputRegister(GPIO_TypeDef *GPIO_x)
{