LT8900 Arduino Library
Public Types | Public Member Functions | List of all members
LT8900 Class Reference

Public Types

enum  DataRate { LT8900_1MBPS, LT8910_250KBPS, LT8910_125KBPS, LT8910_62KBPS }
 

Public Member Functions

 LT8900 (const uint8_t cs, const uint8_t pkt, const uint8_t rst)
 
void begin ()
 
void setChannel (uint8_t channel)
 
uint8_t getChannel ()
 
void setCurrentControl (uint8_t power, uint8_t gain)
 
bool setDataRate (DataRate rate)
 
DataRate getDataRate ()
 
uint16_t readRegister (uint8_t reg)
 
uint8_t writeRegister (uint8_t reg, uint16_t data)
 
uint8_t writeRegister2 (uint8_t reg, uint8_t high, uint8_t low)
 
void sleep ()
 
void whatsUp (Stream &stream)
 
bool available ()
 
bool getIs8910 ()
 
int read (uint8_t *buffer, size_t maxBuffer)
 
void startListening ()
 
void setClock (uint8_t clock)
 
bool sendPacket (uint8_t *data, size_t packetSize)
 
void setSyncWord (uint64_t syncWord)
 
void setSyncWordLength (uint8_t length)
 
void scanRSSI (uint16_t *buffer, uint8_t start_channel, uint8_t num_channels)
 
uint8_t getRSSI ()
 

Member Enumeration Documentation

Data Data While the LT8900 only has support for 1MPBS speed, the LT8910 offers different speeds.

See also
getIs8910
Enumerator
LT8910_250KBPS 

default transmit rate

LT8910_125KBPS 

250 Kpbs, only on lt8910

LT8910_62KBPS 

125 Kbps, only on lt8910 62 Kbps, only on lt8910

Constructor & Destructor Documentation

LT8900::LT8900 ( const uint8_t  cs,
const uint8_t  pkt,
const uint8_t  rst 
)

Construct a new instance

Parameters
csChip Select, this is the SLAVE SELECT pin. Please note that it is a different location than the NRF24L01+ SS pin.
pktPKT_flag input signal pin. Comparable to the NRF24L01+ IRQ pin.
rstRESET pin. Use 0 to disable.

Member Function Documentation

bool LT8900::available ( )

Signals a packet ready in the FIFO queue

void LT8900::begin ( )

Configures the module for initial use

uint8_t LT8900::getChannel ( )

Retrieve the current channel

LT8900::DataRate LT8900::getDataRate ( )

Returns the data rate

Returns
the active data rate.
bool LT8900::getIs8910 ( )

Checks the module type The LT8910 has a few extra features one of it being the extended options for data rate.

Returns
false for a regular LT8900 and true for a LT8910
See also
setDataRate
uint8_t LT8900::getRSSI ( )

retrieve the analog signal strength for the current channel

int LT8900::read ( uint8_t *  buffer,
size_t  maxBuffer 
)

Read a packet into the buffer

Parameters
buffera pointer to a buffer large enough to hold the packet
maxBufferthe maximum size of the buffer. Any bytes left over in the buffer will be dropped.
Returns
the size of the packet that was read, -1 for CRC error
uint16_t LT8900::readRegister ( uint8_t  reg)

Read the value of a register

Parameters
reg
void LT8900::scanRSSI ( uint16_t *  buffer,
uint8_t  start_channel,
uint8_t  num_channels 
)

Scan the signal strength for one or more channels

Parameters
bufferpoints to a buffer to store the signal strengths, at least num_channels
start_channelstarting channel to scan, where Frequency = 2402 + channel
num_channelsnumber of channels to scan in this batch, for example scanning 4 channels with start 2480 will scan 2480, 2481, 2482, 2483
bool LT8900::sendPacket ( uint8_t *  data,
size_t  packetSize 
)

Sends a packet This call blocks until the packet was sent and the Tx Buffer has been completed

Parameters
data
packetSize
Returns
true when the packet was sent, or false when the packetSize was invalid.
void LT8900::setChannel ( uint8_t  channel)

Set the channel.

Parameters
channelhas significant 7 bits
void LT8900::setClock ( uint8_t  clock)

Sets the internal clock divider

Parameters
clock
void LT8900::setCurrentControl ( uint8_t  power,
uint8_t  gain 
)

Set power and gain

Parameters
power0-0xf
gain0-0xf
bool LT8900::setDataRate ( DataRate  rate)

Sets the data rate

Parameters
ratethe transmission/reception speed
Returns
true when the data rate was succesfully changed.
void LT8900::setSyncWord ( uint64_t  syncWord)

Set Syncword

Parameters
syncWord64 bits of sync word settings.
See also
setSyncwordLength
void LT8900::setSyncWordLength ( uint8_t  length)

Sets the length of the sync word used

Parameters
length11 = 64bits, 10 = 48 bits, 01 = 32 bits, 00 = 16 bits
See also
Check the datasheet for which bits are actually used.
void LT8900::sleep ( )

Put the LT8900 module to sleep mode. In contrast to POWER DOWN, this mode will keep the register values Any SPI call will awaken the module automatically

void LT8900::startListening ( )

Switch the module to RX mode

void LT8900::whatsUp ( Stream &  stream)

Dumps debug information on the selected port

Parameters
streamthe output stream to use as output, eg. whatsUp(&Serial);
uint8_t LT8900::writeRegister ( uint8_t  reg,
uint16_t  data 
)

Writes to a register

Parameters
regThe register to write to
data16bits of data, MSB first
uint8_t LT8900::writeRegister2 ( uint8_t  reg,
uint8_t  high,
uint8_t  low 
)

Writes to a register, one byte at a time. This is a convenience function, because the LT8900 uses 16 bits registers with all 16 bits written at once.

Parameters
regThe register to write to
highbits 15..8
lowbits 7..0

The documentation for this class was generated from the following files: