4#ifndef PROTOCORE_CC1101_H
5#define PROTOCORE_CC1101_H
72 int16_t (*rssi_dbm)(uint8_t *, uint8_t);
int16_t protocore_cc1101_rssi_dbm(uint8_t *work, uint8_t raw)
Convert a raw CC1101 RSSI register value to dBm (TI datasheet .
void protocore_cc1101_set_rx(uint8_t *work, const protocore_cc1101_bus *bus)
Flush RX and enter receive mode (strobe RX). Then poll .
proto_bool protocore_cc1101_tx_done(uint8_t *work, const protocore_cc1101_bus *bus)
True once the state machine has returned to IDLE after a transmit.
proto_bool protocore_cc1101_init(uint8_t *work, const protocore_cc1101_bus *bus, const protocore_cc1101_config *cfg)
Reset the CC1101, apply cfg, set the channel, and confirm it is .
proto_bool protocore_cc1101_send(uint8_t *work, const protocore_cc1101_bus *bus, const uint8_t *data, uint8_t len)
Transmit len bytes as a variable-length packet (leading length .
int protocore_cc1101_recv(uint8_t *work, const protocore_cc1101_bus *bus, uint8_t *buf, uint8_t cap, int16_t *rssi_dbm)
If a packet is waiting, read it (length byte + payload + appended .
void(* protocore_cc1101_spi_fn)(const uint8_t *tx, uint8_t *rx, uint8_t len, void *ctx)
Full-duplex SPI transfer of len bytes (chip-select toggled by the callback).
PROTOCORE_NS Cc1101Ns Cc1101 PROTOCORE_UNUSED
Module namespace.
#define PROTOCORE_NS_LAYOUT(T,...)
Pin every dispatch slot of a table that is nothing but function pointers.
#define PROTOCORE_NS
Storage for a dispatch table. The const is load bearing.
Dispatch table. Addressed by offset, so the layout is asserted below.
proto_bool(* init)(uint8_t *, const protocore_cc1101_bus *, const protocore_cc1101_config *)
The bus a driver call uses: your SPI transfer behind it.
protocore_cc1101_spi_fn spi
Radio configuration applied by protocore_cc1101_init().
const protocore_cc1101_reg * regs
SmartRF-exported register settings (may be null for none).
uint8_t channel
CHANNR (0x0A): channel number on top of the base frequency.
One modem-config register write (address + value).
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS