Documentation ¶
Overview ¶
The RFM69 package interfaces with a HopeRF RFM69 radio connected to an SPI bus. In addition, an interrupt capable GPIO pin may be used to avoid having to poll the radio.
Index ¶
Constants ¶
View Source
const ( REG_FIFO = 0x00 REG_OPMODE = 0x01 REG_DATAMODUL = 0x02 REG_BITRATEMSB = 0x03 REG_FDEVMSB = 0x05 REG_FRFMSB = 0x07 REG_AFCCTRL = 0x0B REG_VERSION = 0x10 REG_PALEVEL = 0x11 REG_LNAVALUE = 0x18 REG_RXBW = 0x19 REG_AFCBW = 0x1A REG_AFCMSB = 0x1F REG_AFCLSB = 0x20 REG_FEIMSB = 0x21 REG_FEILSB = 0x22 REG_RSSICONFIG = 0x23 REG_RSSIVALUE = 0x24 REG_DIOMAPPING1 = 0x25 REG_IRQFLAGS1 = 0x27 REG_IRQFLAGS2 = 0x28 REG_SYNCCONFIG = 0x2E REG_SYNCVALUE1 = 0x2F REG_SYNCVALUE2 = 0x30 REG_NODEADDR = 0x39 REG_BCASTADDR = 0x3A REG_FIFOTHRESH = 0x3C REG_PKTCONFIG2 = 0x3D REG_AESKEYMSB = 0x3E MODE_SLEEP = 0 << 2 MODE_STANDBY = 1 << 2 MODE_FS = 2 << 2 MODE_TRANSMIT = 3 << 2 MODE_RECEIVE = 4 << 2 START_TX = 0xC2 STOP_TX = 0x42 RCCALSTART = 0x80 IRQ1_MODEREADY = 1 << 7 IRQ1_RXREADY = 1 << 6 IRQ1_PLLLOCK = 1 << 4 IRQ1_SYNADDRMATCH = 1 << 0 IRQ2_FIFONOTEMPTY = 1 << 6 IRQ2_PACKETSENT = 1 << 3 IRQ2_PAYLOADREADY = 1 << 2 DIO_MAPPING = 0x32 DIO_RSSI = 0xC0 DIO_SYNC = 0x80 DIO_PAYREADY = 0x40 DIO_PKTSENT = 0x00 )
Variables ¶
View Source
var Rates = map[uint32]Rate{
49230: {45000, 0, 0x4A, 0x42},
50000: {45000, 0, 0x4A, 0x42},
}
Rates is the table of supported bit rates and their corresponding register settings. The map key is the bit rate in bits per second.
Functions ¶
Types ¶
type Rate ¶
type Rate struct { Fdev int // TX frequency deviation in Hz Shaping byte // 0:none, 1:gaussian BT=1, 2:gaussian BT=0.5, 3:gaussian BT=0.3 RxBw byte // value for rxBw register (0x19) AfcBw byte // value for afcBw register (0x1A) }
Rate describes the RFM69 configuration to achieve a specific bit rate
type RxInfo ¶
type RxInfo struct {
// contains filtered or unexported fields
}
RxInfo contains stats about a received packet
type RxPacket ¶
type RxPacket struct { Payload []byte // payload, from address to last data byte, excluding length & crc CrcOK bool // whether received CRC is OK Crc uint16 // received CRC Info *RxInfo // stats about the reception }
RxPacket is a received packet with stats
type TemporaryError ¶
type TemporaryError interface {
Temporary() bool // true if the error is temporary (retryable)
}
TemporaryError is an interface that is implemented by errors that may be temporary, i.e., that are retryable
Click to show internal directories.
Click to hide internal directories.