24#ifndef AT86RF2XX_INTERNAL_H
25#define AT86RF2XX_INTERNAL_H
31#if AT86RF2XX_IS_PERIPH
45#ifdef MODULE_AT86RF212B
46#define AT86RF2XX_TXPOWER_MAX (36)
48#define AT86RF2XX_TXPOWER_MAX (21)
50#define AT86RF2XX_TXPOWER_MAX (20)
56#ifdef MODULE_AT86RF212B
57#define AT86RF2XX_TXPOWER_OFF (25)
59#define AT86RF2XX_TXPOWER_OFF (17)
66#define AT86RF2XX_WAKEUP_DELAY (306U)
72#define AT86RF2XX_RESET_PULSE_WIDTH (62U)
80#define AT86RF2XX_RESET_DELAY (62U)
90#if AT86RF2XX_IS_PERIPH
106#if AT86RF2XX_IS_PERIPH
108 const uint8_t value) {
124#if AT86RF2XX_IS_PERIPH
126 uint8_t *data,
size_t len) {
128 memcpy(data, (
void*)(AT86RF2XX_REG__TRXFBST + offset), len);
132 uint8_t *data,
size_t len);
142#if AT86RF2XX_IS_PERIPH
144 const uint8_t *data,
size_t len) {
146 memcpy((
void*)(AT86RF2XX_REG__TRXFBST + offset), data, len);
150 const uint8_t *data,
size_t len);
160#if AT86RF2XX_IS_PERIPH
176#if AT86RF2XX_IS_PERIPH
179 memcpy(data, (
void*)AT86RF2XX_REG__TRXFBST, len);
191#if AT86RF2XX_IS_PERIPH
231#if AT86RF2XX_RANDOM_NUMBER_GENERATOR || defined(DOXYGEN)
268#if AT86RF2XX_IS_PERIPH
269 return TST_RX_LENGTH;
288#if AT86RF2XX_IS_PERIPH
289 uint8_t irq_mask = dev->irq_status;
298#if AT86RF2XX_IS_PERIPH
308static inline uint32_t reg32_read(
volatile uint8_t *reg_ll)
312 reg.
u8[0] = reg_ll[0];
313 reg.
u8[1] = reg_ll[1];
314 reg.
u8[2] = reg_ll[2];
315 reg.
u8[3] = reg_ll[3];
327static inline uint32_t at86rf2xx_get_sc(
const at86rf2xx_t *dev)
330 return reg32_read(&SCCNTLL);
334#define SC_TO_NS (16000LU)
Interface definition for AT86RF2xx based drivers.
void at86rf2xx_fb_stop(const at86rf2xx_t *dev)
Stop a read transaction internal frame buffer of the given device.
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_assert_awake(at86rf2xx_t *dev)
Make sure that device is not sleeping.
void at86rf2xx_spi_init(at86rf2xx_t *dev, void(*irq_handler)(void *arg))
Initialize AT86RF2XX SPI communication.
void at86rf2xx_hardware_reset(at86rf2xx_t *dev)
Trigger a hardware reset.
void at86rf2xx_fb_read(const at86rf2xx_t *dev, uint8_t *data, size_t len)
Read the internal frame buffer of the given device.
uint8_t at86rf2xx_reg_read(const at86rf2xx_t *dev, uint8_t addr)
Read from a register at address addr from device dev.
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.
static uint8_t at86rf2xx_get_rx_len(at86rf2xx_t *dev)
Get the PSDU length of the received frame.
void at86rf2xx_get_random(at86rf2xx_t *dev, uint8_t *data, size_t len)
Read random data from the RNG.
static uint8_t at86rf2xx_get_irq_flags(at86rf2xx_t *dev)
Get the IRQ flags.
void at86rf2xx_reg_write(const at86rf2xx_t *dev, uint8_t addr, uint8_t value)
Write to a register at address addr from device dev.
uint8_t at86rf2xx_get_status(const at86rf2xx_t *dev)
Convenience function for reading the status of the given device.
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.
Register and command definitions for AT86RF2xx devices.
MAYBE_INLINE void irq_restore(unsigned state)
This function restores the IRQ disable bit in the status register to the value contained within passe...
MAYBE_INLINE unsigned irq_disable(void)
This function sets the IRQ disable bit in the status register.
Device descriptor for AT86RF2XX radio devices.
Utility header providing time unit defines.
A 32 bit integer in little endian.
uint32_t u32
32 bit representation
uint8_t u8[4]
8 bit representation