Infrared receiver interface for capturing and processing IR remote control signals.
More...
|
enum | hw_infrared_event_t { HW_INFRARED_EVENT_TIMEOUT = (1 << 0),
HW_INFRARED_EVENT_MARK = (1 << 1),
HW_INFRARED_EVENT_SPACE = (1 << 2)
} |
| Infrared events.
|
|
Infrared receiver interface for capturing and processing IR remote control signals.
This module provides functions to initialize an IR receiver, configure callbacks for signal events, and process MARK/SPACE/TIMEOUT timing data. The implementation of specific protocols is included in the driver library.
The callback is called with either MARK (high pulse), SPACE (low pulse), or TIMEOUT (overly long pulse) events. Events above 50ms are marked as TIMEOUT values, in which case detection of specific IR codes should be reset.
◆ hw_infrared_rx_finalize()
Finalize and release an Infrared receiver.
- Parameters
-
rx | Pointer to the Infrared receiver structure to finalize. |
This function stops the Infrared receiver and releases all associated resources. After calling this function, the Infrared receiver should not be used.
- Examples:
- examples/runtime/infrared/main.c.
◆ hw_infrared_rx_init()
Initialize a Infrared receiver.
- Parameters
-
gpio | The GPIO pin number for the Infrared receiver. |
callback | The callback function to be called on IR events. |
user_data | Pointer to user data to be passed to the callback. |
- Returns
- A Infrared receiver structure representing the initialized unit.
This function initializes an Infrared receiver on the specified GPIO pin. and with the specified user data.
- Examples:
- examples/runtime/infrared/main.c.
◆ hw_infrared_rx_valid()
Check if an Infrared receiver is valid.
- Parameters
-
rx | Pointer to the Infrared receiver structure to check. |
- Returns
- true if the Infrared receiver is valid, false otherwise.
This function checks if the Infrared receiver has been properly initialized and is ready to use.
- Examples:
- examples/runtime/infrared/main.c.