Documentation ¶
Index ¶
- Constants
- Variables
- type Device
- func (d *Device) Close() error
- func (d *Device) GetBandWidth() (uint8, error)
- func (d *Device) GetCodingRate() (uint8, error)
- func (d *Device) GetFrequency() (uint32, error)
- func (d *Device) GetLastPacketRSSI() (int, error)
- func (d *Device) GetLastPacketSNR() (int, error)
- func (d *Device) GetModulationMode() (uint8, error)
- func (d *Device) GetPaSelect() (uint8, error)
- func (d *Device) GetPayloadCrcOn() (bool, error)
- func (d *Device) GetPower() (uint8, error)
- func (d *Device) GetPreambleLength() (uint16, error)
- func (d *Device) GetRSSI() (int, error)
- func (d *Device) GetSpreadingFactor() (uint8, error)
- func (d *Device) GetSyncWord() (uint8, error)
- func (d *Device) GetVersion() (uint8, error)
- func (d *Device) Initialize(settings *Settings) error
- func (d *Device) LoadCurrentParameters() error
- func (d *Device) Open(device string) error
- func (d *Device) ReceiveContinuous() ([]byte, error)
- func (d *Device) ReceiveContinuousIt() error
- func (d *Device) ReceiveSingle() ([]byte, error)
- func (d *Device) ReceiveSingleIt() error
- func (d *Device) Reset()
- func (d *Device) SetBandWidth(bandwidth uint8) error
- func (d *Device) SetCodingRate(codingrate uint8) error
- func (d *Device) SetFrequency(frequency uint32) error
- func (d *Device) SetModulationMode(modulation uint8) error
- func (d *Device) SetPaSelect(input uint8) error
- func (d *Device) SetPayloadCrcOn(crcon bool) error
- func (d *Device) SetPower(power uint8) error
- func (d *Device) SetPreambleLength(preamblelength uint16) error
- func (d *Device) SetRxCrcErrorCallback(callback func())
- func (d *Device) SetRxDoneCallback(callback func([]byte))
- func (d *Device) SetRxTimeoutCallback(callback func())
- func (d *Device) SetSleep() error
- func (d *Device) SetSpreadingFactor(spreadingfactor uint8) error
- func (d *Device) SetStandby() error
- func (d *Device) SetSyncWord(syncword uint8) error
- func (d *Device) SetTxDoneCallback(callback func())
- func (d *Device) Transmit(buffer []byte, delay uint) error
- func (d *Device) TransmitIt(buffer []byte) error
- type Gpio
- type Gpios
- type SPI
- type Settings
Constants ¶
View Source
const ( ModulationFskOok uint8 = iota ModulationLoRa )
Modulation modes
View Source
const ( PaSelectRfo uint8 = iota PaSelectPaBoost )
Pa select
View Source
const ( SpreadingFactor7 uint8 = iota + 7 SpreadingFactor8 SpreadingFactor9 SpreadingFactor10 SpreadingFactor11 SpreadingFactor12 )
Spreading factors
View Source
const ( CodingRate4to5 uint8 = iota + 1 CodingRate4to6 CodingRate4to7 CodingRate4to8 )
Coding rates
View Source
const ( BandWidth125KHz uint8 = iota + 7 BandWidth250KHz BandWidth500KHz )
Band widths
View Source
const ( DeviceModeSLEEP uint8 = iota DeviceModeSTDBY DeviceModeFSTX DeviceModeTX DeviceModeFSRX DeviceModeRXCONTINUOUS DeviceModeRXSINGLE DeviceModeCAD )
device mode
View Source
const ( FlagRxTimeout uint8 = (1 << 7) FlagRxDone uint8 = (1 << 6) FlagPayloadCrcError uint8 = (1 << 5) FlagValidHeader uint8 = (1 << 4) FlagTxDone uint8 = (1 << 3) FlagCadDone uint8 = (1 << 2) FlagFhssChangeChannel uint8 = (1 << 1) FlagCadDetected uint8 = (1 << 0) )
IRQ Flags
View Source
const ( DIO0Mapping = 14 DIO1Mapping = 12 DIO2Mapping = 10 DIO3Mapping = 8 DIO4Mapping = 6 DIO5Mapping = 4 DIOMode0 = 0 DIOMode1 = 1 DIOMode2 = 2 DIOModeDISABLE = 3 )
DIO Modes
View Source
const (
Version = 0x12
)
Default regVersion value
Variables ¶
View Source
var ( ErrorPayloadLength = fmt.Errorf("wrong payload length") ErrorFrequency = fmt.Errorf("frequency out of range") ErrorNoDevice = fmt.Errorf("no device found") ErrorWrongParameter = fmt.Errorf("wrong parameter") ErrorCrc = fmt.Errorf("CRC mistmatch") ErrorNoCrc = fmt.Errorf("no CRC presented") ErrorTimeout = fmt.Errorf("timeout") )
Errors
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device ...
func (*Device) GetLastPacketRSSI ¶
GetLastPacketRSSI ...
func (*Device) GetLastPacketSNR ¶
GetLastPacketSNR ...
func (*Device) GetModulationMode ¶
GetModulationMode ...
func (*Device) GetPayloadCrcOn ¶
GetPayloadCrcOn ...
func (*Device) GetPreambleLength ¶
GetPreambleLength ...
func (*Device) GetSpreadingFactor ¶
GetSpreadingFactor ...
func (*Device) LoadCurrentParameters ¶
LoadCurrentParameters ...
func (*Device) ReceiveContinuous ¶
ReceiveContinuous ...
func (*Device) ReceiveContinuousIt ¶
ReceiveContinuousIt ...
func (*Device) SetCodingRate ¶
SetCodingRate ...
func (*Device) SetFrequency ¶
SetFrequency ...
func (*Device) SetModulationMode ¶
SetModulationMode ...
func (*Device) SetPayloadCrcOn ¶
SetPayloadCrcOn ...
func (*Device) SetPreambleLength ¶
SetPreambleLength ...
func (*Device) SetRxCrcErrorCallback ¶
func (d *Device) SetRxCrcErrorCallback(callback func())
SetRxCrcErrorCallback ...
func (*Device) SetRxDoneCallback ¶
SetRxDoneCallback ...
func (*Device) SetRxTimeoutCallback ¶
func (d *Device) SetRxTimeoutCallback(callback func())
SetRxTimeoutCallback ...
func (*Device) SetSpreadingFactor ¶
SetSpreadingFactor ...
func (*Device) SetTxDoneCallback ¶
func (d *Device) SetTxDoneCallback(callback func())
SetTxDoneCallback ...
Click to show internal directories.
Click to hide internal directories.