esp32-car/include/ir.h

31 lines
371 B
C
Raw Normal View History

2024-12-27 11:32:09 +08:00
#ifndef IR_H
#define IR_H
2025-01-01 13:21:24 +08:00
#include <SoftwareSerial.h>
2024-12-27 11:32:09 +08:00
#include <Arduino.h>
2025-01-01 13:21:24 +08:00
#include "consts.h"
2024-12-27 11:32:09 +08:00
enum IRMode
{
IR_MODE_GPIO,
IR_MODE_UART
};
struct IRData
{
2025-01-01 13:21:24 +08:00
IRMode mode;
uint8_t pins[IR_COUNT];
uint8_t count;
2024-12-27 11:32:09 +08:00
uint8_t data[8];
};
class IR
{
public:
2025-01-01 13:21:24 +08:00
static SoftwareSerial *uart;
2024-12-27 11:32:09 +08:00
static IRData data;
2025-01-01 13:21:24 +08:00
static void init();
2024-12-27 11:32:09 +08:00
static void update();
};
#endif