infrared.h 536 B

123456789101112131415161718192021
  1. /*
  2. * (c) Philippe G. 2019, philippe_44@outlook.com
  3. *
  4. * This software is released under the MIT License.
  5. * https://opensource.org/licenses/MIT
  6. *
  7. */
  8. #pragma once
  9. #include <stdint.h>
  10. #include "freertos/FreeRTOS.h"
  11. #include "freertos/ringbuf.h"
  12. typedef enum {IR_NEC, IR_RC5} infrared_mode_t;
  13. typedef void (*infrared_handler)(uint16_t addr, uint16_t cmd);
  14. bool infrared_receive(RingbufHandle_t rb, infrared_handler handler);
  15. void infrared_init(RingbufHandle_t *rb, int gpio, infrared_mode_t mode);
  16. int8_t infrared_gpio(void);