at86rf2xx_internal.h

Internal interfaces for AT86RF2xx drivers.

AT86RF2XX_TXPOWER_MAX

Max.

1
(20)

allowed transmit power for the transceiver

AT86RF2XX_TXPOWER_OFF

Transmit power offset.

1
(17)
AT86RF2XX_WAKEUP_DELAY

Transition time from SLEEP to TRX_OFF in us, refer figure 7-4, p.42.

1
(306U)

For different environments refer figure 13-13, p.201

AT86RF2XX_RESET_PULSE_WIDTH

Minimum reset pulse width, refer p.190.

1
(62U)

We use 62us so that it is at least one tick on platforms with coarse xtimers

AT86RF2XX_RESET_DELAY

The typical transition time to TRX_OFF after reset pulse is 26 us, refer to figure 7-8, p.

1
(62U)

  1. We use 62 us so that it is at least one tick on platforms that use a 16384 Hz oscillator or have slow start up times due to parasitic capacitance on the oscillator

uint8_t at86rf2xx_reg_read(const at86rf2xx_t * dev, uint8_t addr)

Read from a register at address addr from device dev.

Parameters

dev:device to read from
addr:address of the register to read

Return values

  • the value of the specified register
void at86rf2xx_reg_write(const at86rf2xx_t * dev, uint8_t addr, uint8_t value)

Write to a register at address addr from device dev.

Parameters

dev:device to write to
addr:address of the register to write
value:value to write to the given register

void at86rf2xx_sram_read(const at86rf2xx_t * dev, uint8_t offset, uint8_t * data, msp430_types.h::size_t len)

Read a chunk of data from the SRAM of the given device.

Parameters

dev:device to read from
offset:starting address to read from [valid 0x00-0x7f]
data:buffer to read data into
len:number of bytes to read from SRAM

void at86rf2xx_sram_write(const at86rf2xx_t * dev, uint8_t offset, const uint8_t * data, msp430_types.h::size_t len)

Write a chunk of data into the SRAM of the given device.

Parameters

dev:device to write to
offset:address in the SRAM to write to [valid 0x00-0x7f]
data:data to copy into SRAM
len:number of bytes to write to SRAM

void at86rf2xx_fb_start(const at86rf2xx_t * dev)

Start a read transcation 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.

Parameters

dev:device to start read

void at86rf2xx_fb_read(const at86rf2xx_t * dev, uint8_t * data, msp430_types.h::size_t len)

Read the internal frame buffer of the given device.

Each read advances the position in the buffer by len.

Parameters

dev:device to read from
data:buffer to copy the data to
len:number of bytes to read from the frame buffer

void at86rf2xx_fb_stop(const at86rf2xx_t * dev)

Stop a read transcation internal frame buffer of the given device.

Release the SPI device and unlock frame buffer protection.

Parameters

dev:device to stop read

uint8_t at86rf2xx_get_status(const at86rf2xx_t * dev)

Convenience function for reading the status of the given device.

Parameters

dev:device to read the status from

Return values

  • internal status of the given device
void at86rf2xx_assert_awake(at86rf2xx_t * dev)

Make sure that device is not sleeping.

Parameters

dev:device to eventually wake up

void at86rf2xx_hardware_reset(at86rf2xx_t * dev)

Trigger a hardware reset.

Parameters

dev:device to reset

void at86rf2xx_configure_phy(at86rf2xx_t * dev)

Set PHY parameters based on channel and page number.

Parameters

dev:device to configure

void at86rf2xx_get_random(const at86rf2xx_t * dev, uint8_t * data, msp430_types.h::size_t len)

Read random data from the RNG.

Note

According to the data sheet this function only works properly in Basic Operation Mode. However, sporadic testing has shown that even in Extended Operation Mode this returns random enough data to be used as a seed for Random if no cryptographically secure randomness is required. Any further use-case needs to be evaluated, especially if crypto-relevant randomness is required.

Parameters

dev:device to configure
data:buffer to copy the random data to
len:number of random bytes to store in data