23 #if !defined(BOARD_ATTINYX5) 28 #if defined(BOARD_ATTINY) 95 if (m_rf == 0)
return;
140 config ? (
const uint8_t*) config : CC1101::config,
207 return (
send(dest, port, vec));
211 CC1101::recv(uint8_t& src, uint8_t& port,
void* buf,
size_t len, uint32_t ms)
256 spi.
read(&m_recv_status,
sizeof(m_recv_status));
282 if (dBm < -20) pa = 0x12;
283 else if (dBm < -15) pa = 0x0E;
284 else if (dBm < -10) pa = 0x1D;
285 else if (dBm < 0) pa = 0x34;
286 else if (dBm < 5) pa = 0x60;
287 else if (dBm < 7) pa = 0x84;
288 else if (dBm < 10) pa = 0xC4;
300 int rssi = m_recv_status.
rssi;
301 return (((rssi < 128) ? rssi : rssi - 256) / 2 - 74);
addr_t m_addr
Current network and device address.
uint8_t transfer(uint8_t data)
void acquire(Driver *dev)
Calibrate frequency synthesizer.
virtual bool begin(const void *config=NULL)
void write(uint8_t reg, uint8_t value)
volatile bool m_avail
Message available. May be set by ISR.
virtual int send(uint8_t dest, uint8_t port, const iovec_t *vec)
virtual int input_power_level()
Power down mode when CSn goes high.
void read(void *buf, size_t count)
uint8_t m_channel
Current channel (device dependent.
uint8_t m_dest
Latest message destination device address.
uint8_t rssi
< Bit-field representation (little endian).
void pulse(uint16_t us) const
GDO2 output pin configuration.
Flush the RX FIFO buffer.
virtual int recv(uint8_t &src, uint8_t &port, void *buf, size_t len, uint32_t ms=0L)
uint8_t device
Device address (LSB).
static uint32_t since(uint32_t start)
int16_t network
Network address.
uint8_t read(uint8_t reg)
void write(const void *buf, size_t count)
virtual void on_interrupt(uint16_t arg=0)
Number of configuration registers.
CC1101(uint16_t net, uint8_t dev, Board::DigitalPin csn=Board::D10, Board::ExternalInterruptPin irq=Board::EXT0)
virtual void wakeup_on_radio()
Overflow and # of bytes in RXFIFO.
status_t read_status(uint8_t fifo=1)
void write_P(uint8_t reg, const uint8_t *buf, size_t count)
Start automatic Wake-on-Radio.
static const size_t PAYLOAD_MAX
virtual void output_power_level(int8_t dBm)
OutputPin m_cs
Device chip select pin.
Driver(Board::DigitalPin cs, Pulse pulse=DEFAULT_PULSE, Clock rate=DEFAULT_CLOCK, uint8_t mode=0, Order order=MSB_ORDER, Interrupt::Handler *irq=NULL)
const uint8_t CC1101::config[CC1101::CONFIG_MAX] __PROGMEM
void iovec_arg(iovec_t *&vp, const void *buf, size_t size)
void iovec_end(iovec_t *&vp)
size_t iovec_size(const iovec_t *vec)