Bus master
The pod talks to your board as a bus host: it reads a sensor chip, sends a CAN frame, types into a console. Part of Watch and drive.
Buses
| Bus | Pins | Speed | Tools | Notes |
|---|---|---|---|---|
| I2C | Any 2 LA pins | 10 kHz to 1 MHz | i2c_open, i2c_transfer, i2c_scan, i2c_close | Write, read, or write then read. Switch on a pull-up first (set_pull) or use external pull-ups. |
| SPI | Any 4 LA pins | 190 kHz to 6 MHz, modes 0 to 3 | spi_transfer, spi_flash_info, spi_flash_read, spi_flash_program | Full duplex. Also reads and programs a SPI NOR flash. |
| UART | RX and TX on 2 LA pins | Any baud, parity, 1 or 2 stop bits | uart_open, uart_write, uart_read, uart_close | Send text, wait for a regex. A one-wire (half-duplex) UART works too. |
| CAN, CAN FD | The pod CAN port | Up to 8 Mbit/s data rate | can_open, can_write, can_read, can_respond, can_status, can_close | Switchable 120 ohm termination. can_respond plays an ECU: it answers an id by itself. |
Rules
- Set the I/O voltage (1.8 or 3.3 V) first. The wiring profile gives the default pins.
- One owner per pin: release GPIO channels before opening a bus.
la_pinsshows who owns what. - The I2C master needs gateware v55 or later. The pod never switches a pull-up by itself.
- 5 V buses: see 5 V logic. RS-485 and Modbus: see UART devices.
- Watch the same bus while you drive it: see Logic analyzer.
More
- Emulated sensors: the pod plays the device instead.
- GPIO expander boards: more pins over I2C or SPI.