objc

infrared.h
Go to the documentation of this file.
1 
20 #pragma once
21 #include <stdbool.h>
22 #include <stdint.h>
23 
25 // TYPES
26 
32 typedef struct hw_infrared_rx_t {
33  void *ctx;
35 
41 typedef enum hw_infrared_event_t {
42  HW_INFRARED_EVENT_TIMEOUT = (1 << 0),
43  HW_INFRARED_EVENT_MARK = (1 << 1),
44  HW_INFRARED_EVENT_SPACE = (1 << 2)
46 
53  uint32_t duration_us,
54  void *user_data);
55 
57 // LIFECYCLE
58 
72  void *user_data);
73 
84 
void hw_infrared_rx_finalize(hw_infrared_rx_t *rx)
Finalize and release an Infrared receiver.
bool hw_infrared_rx_valid(hw_infrared_rx_t *rx)
Check if an Infrared receiver is valid.
hw_infrared_event_t
Infrared events.
Definition: infrared.h:41
void * ctx
Context data for the receiver.
Definition: infrared.h:33
Infrared receiver.
Definition: infrared.h:32
hw_infrared_rx_t hw_infrared_rx_init(uint8_t gpio, hw_infrared_rx_callback_t callback, void *user_data)
Initialize a Infrared receiver.
struct hw_infrared_rx_t hw_infrared_rx_t
Infrared receiver.
void(* hw_infrared_rx_callback_t)(hw_infrared_event_t event, uint32_t duration_us, void *user_data)
Infrared receiver.
Definition: infrared.h:52