WIP: Making RFPowerView class

This commit is contained in:
2023-12-22 12:05:24 +11:00
parent c84c2dfbdc
commit 9d507fdb0b
7 changed files with 173 additions and 63 deletions

38
include/RFPowerView.h Normal file
View File

@@ -0,0 +1,38 @@
#ifndef RFPOWERVIEW_H
#define RFPOWERVIEW_H
#include <Arduino.h>
#include <RF24.h>
#include "PacketReceiver.h"
#include "PacketParser.h"
#include "PacketTypes.h"
#define DEFAULT_RF_CHANNEL (7) //this is the channel HD shades use
#define DEFAULT_RF_DATARATE (RF24_1MBPS) //this is the speed HD shades use
class RFPowerView {
public:
RFPowerView(
uint8_t cePin,
uint8_t csPin,
uint8_t irqPin,
uint16_t rfID
);
bool begin();
void loop();
void startListening();
private:
RF24 radio;
PacketReceiver packetReceiver;
PacketParser packetParser;
uint8_t irqPin;
uint8_t rfID[2];
void interruptHandler();
void processPacketBuffer(const uint8_t *buffer);
void processInvalidPacketBuffer(const uint8_t *buffer);
};
#endif // RFPOWERVIEW_H