LibDriver IR_REMOTE
Loading...
Searching...
No Matches
driver_ir_remote_basic.c
Go to the documentation of this file.
1
36
38
39static ir_remote_handle_t gs_handle;
40
49{
50 if (ir_remote_irq_handler(&gs_handle) != 0)
51 {
52 return 1;
53 }
54 else
55 {
56 return 0;
57 }
58}
59
68uint8_t ir_remote_basic_init(void (*callback)(ir_remote_t *data))
69{
70 uint8_t res;
71
72 /* link interface function */
77 DRIVER_IR_REMOTE_LINK_RECEIVE_CALLBACK(&gs_handle, callback);
78
79 /* init */
80 res = ir_remote_init(&gs_handle);
81 if (res != 0)
82 {
83 ir_remote_interface_debug_print("ir_remote: init failed.\n");
84
85 return 1;
86 }
87
88 return 0;
89}
90
99{
100 if (ir_remote_deinit(&gs_handle) != 0)
101 {
102 return 1;
103 }
104
105 return 0;
106}
driver ir_remote basic header file
uint8_t ir_remote_irq_handler(ir_remote_handle_t *handle)
irq handler
uint8_t ir_remote_init(ir_remote_handle_t *handle)
initialize the chip
struct ir_remote_handle_s ir_remote_handle_t
ir_remote handle structure definition
uint8_t ir_remote_deinit(ir_remote_handle_t *handle)
close the chip
struct ir_remote_s ir_remote_t
ir_remote structure definition
uint8_t ir_remote_basic_irq_handler(void)
basic irq
uint8_t ir_remote_basic_init(void(*callback)(ir_remote_t *data))
basic example init
uint8_t ir_remote_basic_deinit(void)
basic example deinit
uint8_t ir_remote_interface_timestamp_read(ir_remote_time_t *t)
interface timestamp read
void ir_remote_interface_delay_ms(uint32_t ms)
interface delay ms
void ir_remote_interface_debug_print(const char *const fmt,...)
interface print format data