Internal interfaces for AT86RF2xx drivers. More...
Internal interfaces for AT86RF2xx drivers.
Definition in file at86rf2xx_internal.h.
Go to the source code of this file.
#define | AT86RF2XX_TXPOWER_MAX (20) |
Max. | |
#define | AT86RF2XX_TXPOWER_OFF (17) |
Transmit power offset. | |
#define | AT86RF2XX_WAKEUP_DELAY (306U) |
Transition time from SLEEP to TRX_OFF in us, refer figure 7-4, p.42. | |
#define | AT86RF2XX_RESET_PULSE_WIDTH (62U) |
Minimum reset pulse width, refer p.190. | |
#define | AT86RF2XX_RESET_DELAY (62U) |
The typical transition time to TRX_OFF after reset pulse is 26 us, refer to figure 7-8, p. | |
uint8_t | at86rf2xx_reg_read (const at86rf2xx_t *dev, uint8_t addr) |
Read from a register at address addr from device dev . | |
void | at86rf2xx_reg_write (const at86rf2xx_t *dev, uint8_t addr, uint8_t value) |
Write to a register at address addr from device dev . | |
void | at86rf2xx_sram_read (const at86rf2xx_t *dev, uint8_t offset, uint8_t *data, size_t len) |
Read a chunk of data from the SRAM of the given device. | |
void | at86rf2xx_sram_write (const at86rf2xx_t *dev, uint8_t offset, const uint8_t *data, size_t len) |
Write a chunk of data into the SRAM of the given device. | |
void | at86rf2xx_fb_start (const at86rf2xx_t *dev) |
Start a read transaction internal frame buffer of the given device. | |
void | at86rf2xx_fb_read (const at86rf2xx_t *dev, uint8_t *data, size_t len) |
Read the internal frame buffer of the given device. | |
void | at86rf2xx_fb_stop (const at86rf2xx_t *dev) |
Stop a read transaction internal frame buffer of the given device. | |
uint8_t | at86rf2xx_get_status (const at86rf2xx_t *dev) |
Convenience function for reading the status of the given device. | |
void | at86rf2xx_assert_awake (at86rf2xx_t *dev) |
Make sure that device is not sleeping. | |
void | at86rf2xx_hardware_reset (at86rf2xx_t *dev) |
Trigger a hardware reset. | |
void | at86rf2xx_configure_phy (at86rf2xx_t *dev, uint8_t chan, uint8_t page, int16_t txpower) |
Set PHY parameters based on channel and page number. | |
void | at86rf2xx_get_random (at86rf2xx_t *dev, uint8_t *data, size_t len) |
Read random data from the RNG. | |
void | at86rf2xx_spi_init (at86rf2xx_t *dev, void(*irq_handler)(void *arg)) |
Initialize AT86RF2XX SPI communication. | |
static uint8_t | at86rf2xx_get_rx_len (at86rf2xx_t *dev) |
Get the PSDU length of the received frame. | |
static uint8_t | at86rf2xx_get_irq_flags (at86rf2xx_t *dev) |
Get the IRQ flags. | |
#define AT86RF2XX_RESET_DELAY (62U) |
The typical transition time to TRX_OFF after reset pulse is 26 us, refer to figure 7-8, p.
Definition at line 80 of file at86rf2xx_internal.h.
#define AT86RF2XX_RESET_PULSE_WIDTH (62U) |
Minimum reset pulse width, refer p.190.
We use 62us so that it is at least one tick on platforms with coarse ztimers
Definition at line 72 of file at86rf2xx_internal.h.
#define AT86RF2XX_TXPOWER_MAX (20) |
#define AT86RF2XX_TXPOWER_OFF (17) |
Transmit power offset.
Definition at line 59 of file at86rf2xx_internal.h.
#define AT86RF2XX_WAKEUP_DELAY (306U) |
Transition time from SLEEP to TRX_OFF in us, refer figure 7-4, p.42.
For different environments refer figure 13-13, p.201
Definition at line 66 of file at86rf2xx_internal.h.
void at86rf2xx_assert_awake | ( | at86rf2xx_t * | dev | ) |
Make sure that device is not sleeping.
[in,out] | dev | device to eventually wake up |
void at86rf2xx_configure_phy | ( | at86rf2xx_t * | dev, |
uint8_t | chan, | ||
uint8_t | page, | ||
int16_t | txpower | ||
) |
Set PHY parameters based on channel and page number.
[in,out] | dev | device to configure |
[in] | chan | channel number to be set |
[in] | page | channel page |
[in] | txpower | TX power in dBm |
void at86rf2xx_fb_read | ( | const at86rf2xx_t * | dev, |
uint8_t * | data, | ||
size_t | len | ||
) |
Read the internal frame buffer of the given device.
Each read advances the position in the buffer by len
.
[in] | dev | device to read from |
[out] | data | buffer to copy the data to |
[in] | len | number of bytes to read from the frame buffer |
void at86rf2xx_fb_start | ( | const at86rf2xx_t * | dev | ) |
Start a read transaction internal frame buffer of the given device.
Reading the frame buffer returns some extra bytes that are not accessible through reading the RAM directly. This locks the used SPI.
[in] | dev | device to start read |
void at86rf2xx_fb_stop | ( | const at86rf2xx_t * | dev | ) |
Stop a read transaction internal frame buffer of the given device.
Release the SPI device and unlock frame buffer protection.
[in] | dev | device to stop read |
|
inlinestatic |
Get the IRQ flags.
This function clears the IRQ flags
[in,out] | dev | pointer to the device descriptor |
Definition at line 285 of file at86rf2xx_internal.h.
void at86rf2xx_get_random | ( | at86rf2xx_t * | dev, |
uint8_t * | data, | ||
size_t | len | ||
) |
Read random data from the RNG.
[in] | dev | device to configure |
[out] | data | buffer to copy the random data to |
[in] | len | number of random bytes to store in data |
|
inlinestatic |
Get the PSDU length of the received frame.
[in] | dev | pointer to the device descriptor |
Definition at line 265 of file at86rf2xx_internal.h.
uint8_t at86rf2xx_get_status | ( | const at86rf2xx_t * | dev | ) |
Convenience function for reading the status of the given device.
[in] | dev | device to read the status from |
void at86rf2xx_hardware_reset | ( | at86rf2xx_t * | dev | ) |
Trigger a hardware reset.
[in,out] | dev | device to reset |
uint8_t at86rf2xx_reg_read | ( | const at86rf2xx_t * | dev, |
uint8_t | addr | ||
) |
Read from a register at address addr
from device dev
.
[in] | dev | device to read from |
[in] | addr | address of the register to read |
void at86rf2xx_reg_write | ( | const at86rf2xx_t * | dev, |
uint8_t | addr, | ||
uint8_t | value | ||
) |
Write to a register at address addr
from device dev
.
[in] | dev | device to write to |
[in] | addr | address of the register to write |
[in] | value | value to write to the given register |
void at86rf2xx_spi_init | ( | at86rf2xx_t * | dev, |
void(*)(void *arg) | irq_handler | ||
) |
Initialize AT86RF2XX SPI communication.
[in,out] | dev | device to initialize |
[in] | irq_handler | IRQ handler |
void at86rf2xx_sram_read | ( | const at86rf2xx_t * | dev, |
uint8_t | offset, | ||
uint8_t * | data, | ||
size_t | len | ||
) |
Read a chunk of data from the SRAM of the given device.
[in] | dev | device to read from |
[in] | offset | starting address to read from [valid 0x00-0x7f] |
[out] | data | buffer to read data into |
[in] | len | number of bytes to read from SRAM |
void at86rf2xx_sram_write | ( | const at86rf2xx_t * | dev, |
uint8_t | offset, | ||
const uint8_t * | data, | ||
size_t | len | ||
) |
Write a chunk of data into the SRAM of the given device.
[in] | dev | device to write to |
[in] | offset | address in the SRAM to write to [valid 0x00-0x7f] |
[in] | data | data to copy into SRAM |
[in] | len | number of bytes to write to SRAM |