21 #ifndef COSA_CC1101_HH 22 #define COSA_CC1101_HH 29 #if !defined(BOARD_ATTINYX5) 84 #if defined(BOARD_ATTINYX4) 85 CC1101(uint16_t net, uint8_t dev,
88 #elif defined(BOARD_ATMEGA2560) 89 CC1101(uint16_t net, uint8_t dev,
93 CC1101(uint16_t net, uint8_t dev,
107 virtual bool begin(
const void* config =
NULL);
128 virtual int send(uint8_t dest, uint8_t port,
const iovec_t* vec);
143 virtual int send(uint8_t dest, uint8_t port,
const void* buf,
size_t len);
160 virtual int recv(uint8_t& src, uint8_t& port,
void* buf,
size_t len,
196 return (m_recv_status.
lqi);
219 header_t(uint8_t addr, uint8_t is_burst, uint8_t is_read)
256 void read(uint8_t
reg,
void* buf,
size_t count)
280 void write(uint8_t
reg,
const void* buf,
size_t count)
351 } __attribute__((packed));
360 return (
read((uint8_t) reg));
372 read((uint8_t) reg, buf, count);
382 write((uint8_t) reg, value);
393 write((uint8_t) reg, buf, count);
405 write_P((uint8_t) reg, buf, count);
415 } __attribute__((packed));
429 return (
read((uint8_t) reg));
440 read((uint8_t) reg, buf, count);
450 write((uint8_t) reg, value);
461 write((uint8_t) reg, buf, count);
472 write_P((uint8_t) reg, buf, count);
496 } __attribute__((packed));
506 read((uint8_t) reg, &res,
sizeof(res));
528 } __attribute__((packed));
549 } __attribute__((packed));
622 } __attribute__((packed));
669 virtual void on_interrupt(uint16_t arg = 0);
GDO0 output pin configuration.
Control state machine state.
uint8_t transfer(uint8_t data)
void read(Config reg, void *buf, size_t count)
static const size_t PATABLE_MAX
Frequency synthesizer cal control.
Front end TX configuration.
void write(Data reg, const void *buf, size_t count)
Frequency Offset Compensation config.
Packet automation control.
void read(uint8_t reg, void *buf, size_t count)
static const size_t DEVICE_PAYLOAD_MAX
void acquire(Driver *dev)
Bit Synchronization configuration.
Frequency control word, high byte.
IRQPin(Board::ExternalInterruptPin pin, InterruptMode mode, CC1101 *rf)
Calibrate frequency synthesizer.
State (Figure 24, pp 50).
virtual int link_quality_indicator()
virtual bool begin(const void *config=NULL)
void write_P(Data reg, const uint8_t *buf, size_t count)
void write(uint8_t reg, uint8_t value)
virtual int send(uint8_t dest, uint8_t port, const iovec_t *vec)
void write(uint8_t reg, const void *buf, size_t count)
Frequency synthesizer calibration running.
virtual int input_power_level()
Frequency synthesizer control.
Power down mode when CSn goes high.
Frequency synthesizer calibration.
void read(void *buf, size_t count)
uint8_t rssi
< Bit-field representation (little endian).
Frequency synthesizer calibration.
GDO2 output pin configuration.
void write_P(Config reg, const uint8_t *buf, size_t count)
Flush the RX FIFO buffer.
Current GDOx status and packet status.
Last RC oscillator calibration result.
virtual int recv(uint8_t &src, uint8_t &port, void *buf, size_t len, uint32_t ms=0L)
Frequency synthesizer calibration.
Underflow and # of bytes in TXFIFO.
AFC adjustment of the frequency synthesizer.
uint8_t lqi
Link Quality Indication.
Low byte Event 0 timeout.
Frequency synthesizer calibration.
Received signal strength indication.
Last RC oscillator calibration result.
void write(Config reg, const void *buf, size_t count)
uint8_t read(uint8_t reg)
void write(const void *buf, size_t count)
Front end RX configuration.
Turn off crystal oscillator.
uint8_t as_uint8
8-bit representation.
Number of status registers.
Number of configuration registers.
CC1101(uint16_t net, uint8_t dev, Board::DigitalPin csn=Board::D10, Board::ExternalInterruptPin irq=Board::EXT0)
Packet automation control.
High byte Event 0 timeout.
virtual void wakeup_on_radio()
Frequency offset estimate.
void write(Config reg, uint8_t value)
Overflow and # of bytes in RXFIFO.
Flush the TX FIFO buffer.
status_t read_status(uint8_t fifo=1)
Frequency synthesizer control.
void write_P(uint8_t reg, const uint8_t *buf, size_t count)
Frequency control word, middle byte.
Start automatic Wake-on-Radio.
static const size_t PAYLOAD_MAX
void read(Data reg, void *buf, size_t count)
Main Radio Cntrl State Machine config.
Frequency control word, low byte.
void write_P(const uint8_t *buf, size_t count)
RC oscillator configuration.
Main Radio Cntrl State Machine config.
Current setting from PLL cal module.
virtual void output_power_level(int8_t dBm)
Demodulator estimate for link quality.
RX FIFO and TX FIFO thresholds.
Main Radio Cntrl State Machine config.
GDO1 output pin configuration.
void write(Data reg, uint8_t value)
RC oscillator configuration.
Enable and calibrate frequency synthesizer.