11 #include <RHHardwareSPI1.h>
13 #include <TeensyThreads.h>
14 #include <support/packetcomm.h>
16 #undef RH_RF22_MAX_MESSAGE_LEN
18 #define RH_RF22_MAX_MESSAGE_LEN 50
20 #define MINIMUM_TIMEOUT 100
52 RFM23(uint8_t slaveSelectPin, uint8_t interruptPin,
53 RHGenericSPI &spi = hardware_spi1);
54 bool init(rfm23_config cfg, Threads::Mutex *mtx);
69 Threads::Mutex *spi_mtx;
The RFM23 radio class.
Definition: rfm23.h:25
RFM23(uint8_t slaveSelectPin, uint8_t interruptPin, RHGenericSPI &spi=hardware_spi1)
Construct a new RFM23 object. Wraps the RH_RFM23 constructor.
Definition: rfm23.cpp:18
bool init(rfm23_config cfg, Threads::Mutex *mtx)
Initialize the RFM23 radio.
Definition: rfm23.cpp:32
int32_t recv(PacketComm &packet, uint16_t timeout)
Receive a packet from the radio.
Definition: rfm23.cpp:138
bool send(PacketComm &packet)
Sends a packet through the radio.
Definition: rfm23.cpp:95
void reset()
Resets the radio.
Definition: rfm23.cpp:76
Definition: packetcomm.h:13
The header file for helper functions.
PacketComm packet
The packet used throughout the channel.
Definition: pdu_channel.cpp:19
The RFM23 radio configuration.
Definition: rfm23.h:28
uint16_t freq
The receive/transmit center frequency.
Definition: rfm23.h:30
uint8_t cs
The chip select pin used on the SPI interface.
Definition: rfm23.h:44
uint8_t spi_sck
The clock pin used on the SPI interface.
Definition: rfm23.h:40
uint8_t tx_power
The transmit power, set as a macro.
Definition: rfm23.h:32
uint8_t nirq
The interrupt pin.
Definition: rfm23.h:42
uint8_t spi_mosi
The MOSI pin used on the SPI interface.
Definition: rfm23.h:38
uint8_t tx_on
The transmit enable pin.
Definition: rfm23.h:46
uint8_t rx_on
The receive enable pin.
Definition: rfm23.h:48
uint8_t spi_miso
The MISO pin used on the SPI interface.
Definition: rfm23.h:36