This project is an STM32 implementation of the Arduino RC5 IR Remote Library, designed for STM32 Nucleo-F411RE using STM32CubeIDE.
The project reads RC5 protocol signals using external interrupts (EXTI) in a fully non-blocking manner. It includes a custom micros()
function that emulates Arduino’s micros()
functionality, without requiring an external hardware timer.
- ✅ Non-blocking RC5 signal decoding via EXTI interrupts
- ✅ RC5 protocol implementation based on the Arduino library logic
- ✅ Custom
micros()
function using only SysTick - ✅ No external libraries or hardware timers required
- ✅ Developed for STM32 Nucleo-F411RE in STM32CubeIDE
To integrate this RC5 decoder into your own STM32 project:
- Select a GPIO pin connected to the IR receiver (e.g.
PA0
). - Set the GPIO mode to
GPIO_EXTI
. - Enable Interrupt trigger for Both rising and falling edges.
- In STM32CubeMX or STM32CubeIDE:
- Go to the NVIC tab
- Enable the corresponding EXTI interrupt line (e.g.
EXTI0
for pinPA0
).
Copy:
micros()
function- All related global variables
Copy:
EXTIx_IRQHandler()
implementation (e.g.,EXTI0_IRQHandler
)- RC5 decoding logic based on pulse timing
Ensure that the interrupt handler matches your selected GPIO pin and EXTI line.
- in 'RC5read1' function change the pin label in 'HAL_GPIO_ReadPin' to your pin label. Here, pin has label 'IR_IN'.