28 #if !defined(BOARD_ATTINYX5) 79 #if defined(BOARD_ATTINYX4) 80 RFM69(uint16_t net, uint8_t dev,
83 #elif defined(BOARD_ATMEGA2560) 84 RFM69(uint16_t net, uint8_t dev,
88 RFM69(uint16_t net, uint8_t dev,
101 virtual bool begin(
const void* config =
NULL);
122 virtual int send(uint8_t dest, uint8_t port,
const iovec_t* vec);
136 virtual int send(uint8_t dest, uint8_t port,
const void* buf,
size_t len);
153 virtual int recv(uint8_t& src, uint8_t& port,
void* buf,
size_t len,
257 PACKET_CONFIG1 = 0x37,
258 PAYLOAD_LENGTH = 0x38,
260 BROADCAST_ADDR = 0x3A,
262 FIFO_THRESHOLD = 0x3C,
263 PACKET_CONFIG2 = 0x3D,
272 } __attribute__((packed));
282 } __attribute__((packed));
289 uint8_t read(Reg reg)
306 void read(Reg reg,
void* buf,
size_t count)
321 void write(Reg reg, uint8_t value)
337 void write(Reg reg,
const void* buf,
size_t count)
353 void write_P(Reg reg,
const uint8_t* buf,
size_t count)
367 SEQUENCER_OFF = 0x80,
373 } __attribute__((packed));
380 CONTINUOUS_MODE_WITH_BIT_SYNC = 0x40,
381 CONTINUOUS_MODE_WITHOUT_BIT_SYNC = 0x60,
382 FSK_MODULATION = 0x00,
383 OOK_MODULATION = 0x80,
384 FSK_NO_SHAPING = 0x00,
388 OOK_NO_SHAPING = 0x00,
391 } __attribute__((packed));
399 } __attribute__((packed));
405 AFC_LOW_BETA_OFF = 0x00,
406 AFC_LOW_BETA_ON = 0x20,
407 } __attribute__((packed));
413 RESOL_IDLE_64_US = 0x40,
414 RESOL_IDLE_410_US = 0x80,
415 RESOL_IDLE_262000_US = 0xC0,
416 RESOL_RX_64_US = 0x10,
417 RESOL_RX_410_US = 0x20,
418 RESOL_RX_262000_US = 0x30,
419 CRITERIA_RSSI_THRESHOLD = 0x00,
420 CRITERIA_RSSI_SYNC_THRESHOLD = 0x08,
424 } __attribute__((packed));
437 OUTPUT_POWER_MASK = 0x1F,
438 FULL_OUTPUT_POWER = 0x1F
439 } __attribute__((packed));
449 } __attribute__((packed));
458 CURRENT_GAIN_MASK = 0x07,
460 SELECT_GAIN_MASK = 0x07
461 } __attribute__((packed));
468 DCC_FREQ_MASK = 0x07,
474 } __attribute__((packed));
480 OOK_THRESHOLD_FIXED = 0x00,
481 OOK_THRESHOLD_PEAK = 0x40,
482 OOK_THRESHOLD_AVG = 0x80,
483 OOK_PEAK_THRESHOLD_STEP = 3,
484 OOK_PEAK_THRESHOLD_STEP_MASK = 0x7,
485 OOK_PEAK_THRESHOLD_DECR = 0,
486 OOK_PEAK_THRESHOLD_DECR_MASK = 0x7
487 } __attribute__((packed));
493 OOK_AVG_THRESHOLD_FILTER_32_PI = 0x00,
494 OOK_AVG_THRESHOLD_FILTER_8_PI = 0x40,
495 OOK_AVG_THRESHOLD_FILTER_4_PI = 0x80,
496 OOK_AVG_THRESHOLD_FILTER_2_PI = 0xC0
497 } __attribute__((packed));
506 AFC_AUTO_CLEAR_ON = 0x08,
510 } __attribute__((packed));
518 } __attribute__((packed));
530 DIO_MAPPING_MASK = 0x3,
533 } __attribute__((packed));
546 SYNC_ADDR_MATCH = 0x01,
547 } __attribute__((packed));
554 FIFO_NOT_EMPTY = 0x40,
558 PAYLOAD_READY = 0x04,
560 } __attribute__((packed));
568 FIFO_FILL_AUTO = 0x00,
569 FIFO_FILL_MANUAL = 0x40,
571 SYNC_SIZE_MASK = 0x7,
574 } __attribute__((packed));
581 VARIABLE_LENGTH = 0x80,
587 CRC_AUTO_CLEAR_OFF = 0x08,
588 CRC_AUTO_CLEAR_ON = 0x00,
589 ADDR_FILTER_OFF = 0x00,
590 ADDR_FILTER_ON = 0x04,
591 ADDR_FILTER_NODE = 0x02
592 } __attribute__((packed));
598 INTER_PACKET_RX_DELAY = 4,
599 INTER_PACKET_RX_DELAY_MASK = 0xF,
601 AUTO_RX_RESTART_ON = 0x02,
602 AUTO_RX_RESTART_OFF = 0x00,
605 } __attribute__((packed));
611 TX_START_THRESHOLD = 0x00,
612 TX_START_NOT_EMPTY = 0x80,
613 FIFO_THRESHOLD_MASK = 0x7F
614 } __attribute__((packed));
620 TEMP_MEAS_START = 0x08,
621 TEMP_MEAS_RUNNING = 0x04
622 } __attribute__((packed));
628 TEST_LNA_NORMAL_SENSITIVITY = 0x1B,
629 TEST_LNA_HIGH_SENSITIVITY = 0x2D,
630 TEST_PA1_NORMAL_MODE = 0x55,
631 TEST_PA1_BOOST_20_DB_MODE = 0x5D,
632 TEST_PA2_NORMAL_MODE = 0x70,
633 TEST_PA2_BOOST_20_DB_MODE = 0x7C,
634 TEST_DAGC_NORMAL_MODE = 0x00,
635 TEST_DAGC_IMPROVED_MARGIN_AFC_LOW_BETA_ON = 0x20,
636 TEST_DAGC_IMPROVED_MARGIN_AFC_LOG_BETA_OFF = 0x30
637 } __attribute__((packed));
645 FREQUENCY_SYNTHESIZER_MODE = 0x08,
646 TRANSMITTER_MODE = 0x0C,
648 } __attribute__((packed));
680 virtual void on_interrupt(uint16_t arg = 0);
691 volatile bool m_done;
uint8_t transfer(uint8_t data)
void acquire(Driver *dev)
static const size_t PAYLOAD_MAX
void read(void *buf, size_t count)
void write(const void *buf, size_t count)
virtual void output_power_level(int8_t dBm)
virtual int send(uint8_t dest, uint8_t port, const iovec_t *vec)
RFM69(uint16_t net, uint8_t dev, Board::DigitalPin csn=Board::D10, Board::ExternalInterruptPin irq=Board::EXT0)
virtual bool begin(const void *config=NULL)
virtual void wakeup_on_radio()
static const size_t HEADER_MAX
virtual int input_power_level()
void write_P(const uint8_t *buf, size_t count)
virtual int recv(uint8_t &src, uint8_t &port, void *buf, size_t len, uint32_t ms=0L)