LT8900 Arduino Library

- Main Page
- Classes
- Files

- Class List
- Class Index
- Class Members

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

enum LT8900::DataRate

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

  cs | Chip Select, this is the SLAVE SELECT pin. Please note that it is a different location than the NRF24L01+ SS pin.
  pkt | PKT_flag input signal pin. Comparable to the NRF24L01+ IRQ pin.
  rst | RESET 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

  buffer | a pointer to a buffer large enough to hold the packet
  maxBuffer | the 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

  buffer | points to a buffer to store the signal strengths, at least num_channels
  start_channel | starting channel to scan, where Frequency = 2402 + channel
  num_channels | number 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

  channel | has 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

  power | 0-0xf
  gain | 0-0xf

bool LT8900::setDataRate | ( | DataRate | rate | ) |

Sets the data rate

Parameters

  rate | the transmission/reception speed

Returns
  true when the data rate was succesfully changed.

void LT8900::setSyncWord | ( | uint64_t | syncWord | ) |

Set Syncword

Parameters

  syncWord | 64 bits of sync word settings.

See also
  setSyncwordLength

void LT8900::setSyncWordLength | ( | uint8_t | length | ) |

Sets the length of the sync word used

Parameters

  length | 11 = 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

  stream | the output stream to use as output, eg. `whatsUp(&Serial);`

uint8_t LT8900::writeRegister | ( | uint8_t | reg,
|  | uint16_t | data
| ) |  |

Writes to a register

Parameters

  reg | The register to write to
  data | 16bits 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

  reg | The register to write to
  high | bits 15..8
  low | bits 7..0

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

- LT8900.h
- LT8900.cpp