Documentation ¶
Index ¶
- Constants
- Variables
- func GetCLM(firmware []byte) []byte
- type Config
- type Device
- func (d *Device) GPIOSet(wlGPIO uint8, value bool) (err error)
- func (d *Device) HardwareAddr6() ([6]byte, error)
- func (d *Device) Init(cfg Config) (err error)
- func (d *Device) IsLinkUp() bool
- func (d *Device) JoinWPA2(ssid, pass string) error
- func (d *Device) MACAs6() [6]bytedeprecated
- func (d *Device) MTU() int
- func (d *Device) NetFlags() (flags net.Flags)
- func (d *Device) PollOne() (bool, error)
- func (d *Device) RecvEthHandle(handler func(pkt []byte) error)
- func (d *Device) Reset()
- func (d *Device) SendEth(pkt []byte) error
- func (d *Device) SetLogger(l *slog.Logger)
- func (d *Device) StartAP(ssid, pass string, channel uint8) error
- func (d *Device) TryPoll() (gotPacket bool, err error)deprecated
- type Function
- type Interrupts
- type Status
- func (s Status) DataUnavailable() bool
- func (s Status) F2Interrupt() bool
- func (s Status) F2PacketAvailable() bool
- func (s Status) F2PacketLength() uint16
- func (s Status) F2RxReady() bool
- func (s Status) F3PacketAvailable() bool
- func (s Status) F3PacketLength() uint16
- func (s Status) F3RxReady() bool
- func (s Status) GSPIPacketAvailable() bool
- func (s Status) HostCommandDataError() bool
- func (s Status) IsOverflow() bool
- func (s Status) IsUnderflow() bool
- func (s Status) String() (str string)
Constants ¶
const ( // Custom, officially unsupported mode. Use at your own risk. // All power-saving features set to their max at only a marginal decrease in power consumption // as oppposed to `Aggressive`. SuperSave = iota // Aggressive power saving mode. Aggressive // The default mode. PowerSave // Performance is prefered over power consumption but still some power is conserved as opposed to // `None`. Performance // Unlike all the other PM modes, this lowers the power consumption at all times at the cost of // a much lower throughput. ThroughputThrottling // No power management is configured. This consumes the most power. None )
const MTU = 2048 - mtuPrefix
Variables ¶
var ErrDataNotAvailable = errors.New("requested data not available")
Functions ¶
Types ¶
type Config ¶
func DefaultWifiConfig ¶
func DefaultWifiConfig() Config
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
type OutputPin func(bool)
func (*Device) HardwareAddr6 ¶
HardwareAddr6 returns the device's 6-byte MAC address.
func (*Device) MTU ¶
MTU (maximum transmission unit) returns the maximum amount of bytes that can be sent in a single ethernet frame in a call to SendEth.
func (*Device) PollOne ¶
PollOne attempts to read a packet from the device. Returns true if a packet was read, false if no packet was available.
func (*Device) RecvEthHandle ¶
RecvEthHandle sets handler for receiving Ethernet pkt If set to nil then incoming packets are ignored.
type Function ¶
type Function uint32
const ( // All SPI-specific registers. FuncBus Function = 0b00 // Registers and memories belonging to other blocks in the chip (64 bytes max). FuncBackplane Function = 0b01 // DMA channel 1. WLAN packets up to 2048 bytes. FuncDMA1 Function = 0b10 FuncWLAN = FuncDMA1 // DMA channel 2 (optional). Packets up to 2048 bytes. FuncDMA2 Function = 0b11 )
type Interrupts ¶
type Interrupts uint16
func (Interrupts) IsBusOverflowedOrUnderflowed ¶
func (Int Interrupts) IsBusOverflowedOrUnderflowed() bool
func (Interrupts) IsDataUnavailable ¶
func (Int Interrupts) IsDataUnavailable() bool
func (Interrupts) IsF2Available ¶
func (Int Interrupts) IsF2Available() bool
func (Interrupts) String ¶
func (Int Interrupts) String() (s string)
type Status ¶
type Status uint32
Status supports status notification to the host after a read/write transaction over gSPI. This status notification provides information about packet errors, protocol errors, available packets in the RX queue, etc. The status information helps reduce the number of interrupts to the host. The status-reporting feature can be switched off using a register bit, without any timing overhead.
func (Status) DataUnavailable ¶
DataUnavailable returns true if requested read data is unavailable.
func (Status) F2Interrupt ¶
F2Interrupt returns true if F2 channel interrupt set.
func (Status) F2PacketAvailable ¶
F2PacketAvailable returns true if Packet is available/ready in F2 TX FIFO.
func (Status) F2PacketLength ¶
F2PacketAvailable returns F2 packet length.
func (Status) F3PacketAvailable ¶
F3PacketAvailable returns true if Packet is available/ready in F3 TX FIFO.
func (Status) F3PacketLength ¶
F3PacketAvailable returns F3 packet length.
func (Status) GSPIPacketAvailable ¶
GSPIPacketAvailable notifies there is a packet available over gSPI.
func (Status) HostCommandDataError ¶
HostCommandDataError TODO document.
func (Status) IsOverflow ¶
IsOverflow returns true if FIFO overflow occurred due to current (F1, F2, F3) write command.
func (Status) IsUnderflow ¶
IsUnderflow returns true if FIFO underflow occurred due to current (F2, F3) read command.