Documentation ¶
Index ¶
- Constants
- type Command
- type ErrorCode
- type Radio
- func (r *Radio) Close()
- func (*Radio) Device() string
- func (r *Radio) Error() error
- func (r *Radio) Frequency() uint32
- func (r *Radio) Init(frequency uint32)
- func (*Radio) Name() string
- func (r *Radio) ReadRegister(addr byte) byte
- func (r *Radio) Receive(timeout time.Duration) ([]byte, int)
- func (r *Radio) Reset()
- func (r *Radio) Send(data []byte)
- func (r *Radio) SendAndReceive(p []byte, timeout time.Duration) ([]byte, int)
- func (r *Radio) SetError(err error)
- func (r *Radio) SetFrequency(freq uint32)
- func (r *Radio) State() string
- func (r *Radio) Version() string
- func (r *Radio) WriteRegister(addr byte, value byte)
Constants ¶
const ( FXOSC = 24000000 // Crystal frequency in Hz FREQ2 = 0x09 // Frequency control word, high byte FREQ1 = 0x0A // Frequency control word, middle byte FREQ0 = 0x0B // Frequency control word, low byte )
CC111x hardware-related constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command byte
Command represents a command used by subg_rfspy firmware running on CC111x. See https://github.com/ps2/subg_rfspy
type ErrorCode ¶
type ErrorCode byte
ErrorCode represents an error that can be returned by subg_rfspy firmware.
type Radio ¶
type Radio struct {
// contains filtered or unexported fields
}
Radio represents an open radio device.
func (*Radio) ReadRegister ¶
ReadRegister returns the value of a CC111x register. This is only available on subg_rfspy 1.0 or later.
func (*Radio) Receive ¶
Receive listens with the given timeout for an incoming packet. It returns the packet and the associated RSSI.
func (*Radio) SendAndReceive ¶
SendAndReceive sends the given packet, then listens with the given timeout for an incoming packet. It returns the packet and the associated RSSI.
func (*Radio) SetFrequency ¶
SetFrequency sets the radio to the given frequency, in Hertz.
func (*Radio) WriteRegister ¶
WriteRegister writes a value to a CC111x register.