Documentation ¶
Index ¶
- Constants
- func BV(b Bit) byte
- func GoIdle(rf *NRFTransmitter)
- func Init(rf *NRFTransmitter, settings TransmitterSettings)
- func Listen(rf *NRFTransmitter, address TranscieverModel.Address)
- func SetRfChannel(rf *NRFTransmitter, channel byte)
- func Transmit(rf *NRFTransmitter, a TranscieverModel.Address, data TranscieverModel.Payload)
- func ValidateRfChannel(channel byte) bool
- type Bit
- type Command
- type NRFTransmitter
- type Register
- type TransmitterSettings
Constants ¶
View Source
const ( CReadRegister Command = 0x00 CWriteRegister = 0x20 CReadRxPayloadWidth = 0x60 CReadRxPayload = 0x61 CWriteTxPayload = 0xA0 CWriteAckPayload = 0xA8 CWriteTxPayloadNoAck = 0xB0 CFlushTx = 0xE1 CFlushRx = 0xE2 CReuseTxPl = 0xE3 CNop = 0xFF )
nRF24L01 commands
View Source
const ( RConfig Register = 0x00 BMaskRxDr Bit = 6 BMaskTxDs = 5 BMaskMaxRt = 4 BEnCrc = 3 BCrcO = 2 BPwrUp = 1 BPrimRx = 0 REnAA Register = 0x01 BEnAAP5 Bit = 5 BEnAAP4 = 4 BEnAAP3 = 3 BEnAAP2 = 2 BEnAAP1 = 1 BEnAAP0 = 0 REnRxAddr Register = 0x02 BEnRxP5 Bit = 5 BEnRxP4 = 4 BEnRxP3 = 3 BEnRxP2 = 2 BEnRxP1 = 1 BEnRxP0 = 0 RSetupAW Register = 0x03 BAW Bit = 0 RSetupRetr Register = 0x04 BARD Bit = 4 BARC = 0 RRFCh Register = 0x05 RRFSetup Register = 0x06 BContWave Bit = 7 BRfDrLow = 5 BPllLock = 4 BRfDrHigh = 3 BRfPwr = 1 RStatus Register = 0x07 BRxDr Bit = 6 BTxDs = 5 BMaxRt = 4 BRxPNo = 1 BStatusTxFull = 0 BRxPNoMask byte = 0x0E RObserveTx Register = 0x08 BPLosCnt Bit = 4 BArcCnt = 0 RRPD Register = 0x09 RRxAddrP0 = 0x0A RRxAddrP1 = 0x0B RRxAddrP2 = 0x0C RRxAddrP3 = 0x0D RRxAddrP4 = 0x0E RRxAddrP5 = 0x0F RTxAddr = 0x10 RRxPwP0 = 0x11 RRxPwP1 = 0x12 RRxPwP2 = 0x13 RRxPwP3 = 0x14 RRxPwP4 = 0x15 RRxPwP5 = 0x16 RFifoStatus Register = 0x17 BTxReuse Bit = 6 BFifoTxFull = 5 BTxEmpty = 4 BRxFull = 1 BRxEmpty = 0 RDynPd Register = 0x1C BDplP5 Bit = 5 BDplP4 = 4 BDplP3 = 3 BDplP2 = 2 BDplP1 = 1 BDplP0 = 0 RFeature Register = 0x1D BEnDpl Bit = 2 BEnAckPay = 1 BEnDynAck = 0 )
nRF24L01 registers and bits
Variables ¶
This section is empty.
Functions ¶
func Listen ¶
func Listen(rf *NRFTransmitter, address TranscieverModel.Address)
Listen — switch transciever to a listen mode
func SetRfChannel ¶
func SetRfChannel(rf *NRFTransmitter, channel byte)
func Transmit ¶
func Transmit(rf *NRFTransmitter, a TranscieverModel.Address, data TranscieverModel.Payload)
Transmit async request to a transciever, return immediately
func ValidateRfChannel ¶
Types ¶
type NRFTransmitter ¶
type NRFTransmitter struct { TranscieverModel.Transmitter ReceiveMessage chan TranscieverModel.Message //SendMessage chan TranscieverModel.Message SendMessageStatus chan TranscieverModel.Message // contains filtered or unexported fields }
NRFTransmitter "handle"
func (*NRFTransmitter) SendCommand ¶
func (rf *NRFTransmitter) SendCommand(a TranscieverModel.Address, data TranscieverModel.Payload) (ret TranscieverModel.Message)
SendCommand — synchronous method: send request and wait response or timeout
Click to show internal directories.
Click to hide internal directories.