The RFM23 radio class.
More...
#include <rfm23.h>
◆ RFM23()
Artemis::Devices::RFM23::RFM23 |
( |
uint8_t |
slaveSelectPin, |
|
|
uint8_t |
interruptPin, |
|
|
RHGenericSPI & |
spi = hardware_spi1 |
|
) |
| |
Construct a new RFM23 object. Wraps the RH_RFM23 constructor.
- Parameters
-
slaveSelectPin | The chip select pin unique to this instance. |
interruptPin | The interrupt pin unique to this instance. |
spi | The SPI interface connecting the Teensy to the radio. |
◆ init()
bool Artemis::Devices::RFM23::init |
( |
rfm23_config |
cfg, |
|
|
Threads::Mutex * |
mtx |
|
) |
| |
Initialize the RFM23 radio.
- Parameters
-
cfg | The radio's configuration struct. |
mtx | The mutex for the radio's SPI interface. |
- Returns
- true The radio could be connected to and configured properly.
-
false The radio could not be connected to or configured.
- Todo:
- The function puts the rfm23 into sleep mode, then idle mode. Is this intended? idle overrides sleep.
◆ recv()
int32_t Artemis::Devices::RFM23::recv |
( |
PacketComm & |
packet, |
|
|
uint16_t |
timeout |
|
) |
| |
Receive a packet from the radio.
- Parameters
-
packet | The packet that will hold the received data. |
timeout | The time to wait for a packet from the radio. |
- Returns
- int32_t The size of the received packet, or -1 if failed to receive.
- Todo:
- The transmit and receive pins are set high and low respectively. check if this is intended behavior. either change the pin definitions or use setGpioReversed().
◆ send()
bool Artemis::Devices::RFM23::send |
( |
PacketComm & |
packet | ) |
|
Sends a packet through the radio.
- Parameters
-
packet | The packet to be sent. |
- Returns
- true The packet was successfully sent.
-
false There was an error sending the packet.
- Todo:
- The function puts the rfm23 into sleep mode, then idle mode. Is this intended? idle overrides sleep.
- Todo:
- The transmit and receive pins are set low and high respectively. check if this is intended behavior. either change the pin definitions or use setGpioReversed().
The documentation for this class was generated from the following files: