diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2021-10-26 00:10:06 -0600 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2021-10-26 00:10:06 -0600 |
commit | f9b12f748b557994b958115c04fd1591b322248e (patch) | |
tree | 7d80680edadf5b0018944966af64f8773bfa8f1a /include/drv/ir/ir.h | |
parent | dbbe83bd8882fe18e26f6305a1f425145bfea8db (diff) | |
parent | 90eb3a0b79bfef67c70dc545b49c48928eea05f4 (diff) | |
download | stm32l4-f9b12f748b557994b958115c04fd1591b322248e.tar.gz stm32l4-f9b12f748b557994b958115c04fd1591b322248e.tar.bz2 stm32l4-f9b12f748b557994b958115c04fd1591b322248e.zip |
Merge branch 'christmas' into HEAD
Diffstat (limited to 'include/drv/ir/ir.h')
-rw-r--r-- | include/drv/ir/ir.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/drv/ir/ir.h b/include/drv/ir/ir.h new file mode 100644 index 0000000..0a747e8 --- /dev/null +++ b/include/drv/ir/ir.h @@ -0,0 +1,34 @@ +#ifndef _DRV_IR_IR_H_ +#define _DRV_IR_IR_H_ + +#include "kern/common.h" + +typedef struct { + uint16_t ts[64]; /* Timestamps. Microseconds. */ + uint8_t n; +} ir_code_t; + +typedef struct { + uint32_t c; +} decoded_ir; + +/* + * Attempt to decode the provided ir code. + * + * The generic ir is: + * + * The frame starts out as really-long, half(ish) as long, short. If + * this basic frame header does not exist decoding cannot continue. + * + * A short code followed by a short code = 0 + * A long code followed by a short code = 1 + * + * returns non-zero on successful decode. + */ +int ir_generic_decode(const ir_code_t* code, uint32_t* out); + +void add_ir_callback(void(*callback)(const ir_code_t*)); + +void ir_begin_listen(); + +#endif /* _DRV_IR_IR_H_ */ |