attnode/Firmware/lib/RFM95/RFM95.h

42 lines
874 B
C
Raw Permalink Normal View History

2019-09-19 03:40:34 +00:00
/*
RFM95.h - Library header file for RFM95 LoRa module.
Created by Leo Korbee, March 31, 2018.
Released into the public domain.
@license Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
Thanks to all the folks who contributed beforme me on this code.
*/
#ifndef RFM95_h
#define RMF95_h
#include "Arduino.h"
2020-01-20 12:43:37 +00:00
typedef enum lora_dr
{
SF7BW125,
SF8BW125,
SF9BW125,
SF10BW125,
SF11BW125,
SF12BW125,
} lora_dr_t;
2019-09-19 03:40:34 +00:00
class RFM95
{
public:
RFM95(int DIO0, int NSS);
void init();
void RFM_Write(unsigned char RFM_Address, unsigned char RFM_Data);
unsigned char RFM_Read(unsigned char RFM_Address);
void RFM_Send_Package(unsigned char *RFM_Tx_Package, unsigned char Package_Length);
2020-01-20 12:43:37 +00:00
void RFM_Set_Datarate(lora_dr_t datarate);
2019-09-19 03:40:34 +00:00
private:
int _DIO0;
int _NSS;
2020-01-20 12:43:37 +00:00
unsigned char _sf, _bw, _mc;
2019-09-19 03:40:34 +00:00
};
#endif