Documentation
¶
Overview ¶
Package combi drives the CombiAdapter over USB via gotmc/libusb (cgo; requires libusb-1.0). Importing the package registers the "CombiAdapter" adapter. It is kept out of adapters/all so that package stays pure Go — import this package directly.
Wire protocol: packets are cmd, size (u16 BE), payload, terminator (0x00 ack / 0xFF nak) in both directions. The firmware acks every TX frame (cmdCanTxFrame back) and is single-threaded, so Send waits for the ack before returning; the Bus serializes Send callers.
Firmware 1.2 added a CAN acceptance filter (cmdCanFilter): up to 32 little-endian uint32 IDs, dropped on the adapter before they cross USB. Open reads the firmware version and only installs the filter on >= 1.2; older firmware relays the whole bus and the Bus's subscription dispatch does the filtering host-side.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Combi ¶
type Combi struct {
// contains filtered or unexported fields
}
func (*Combi) GetADCValue ¶
GetADCValue reads one of the board's analog inputs (float32 reply). Requires the read loop for the reply.