joule: align SPI bus numbering with reality
Also update docs to make the numbering and pins used crystal clear. Closes #758. Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
This commit is contained in:
@@ -14,26 +14,22 @@ Interface notes
|
|||||||
|
|
||||||
**SPI**
|
**SPI**
|
||||||
|
|
||||||
Two SPI buses are available, with one chipselect each. Pins listed are MRAA
|
Two SPI buses are available, one with three and another one with two chipselects.
|
||||||
numbered pins. Other chip selects are available if enabled in BIOS/EEPROM but
|
In MRAA terms an SPI "bus" (denoted by a number) is a combination
|
||||||
cannot be enabled as BIOS options. You will need the spidev kernel module
|
of an actual bus + specific chipselect on this bus. In view of that + taking
|
||||||
loaded, Ostro-XT and ref-os-iot does this by default.
|
into account that SPI1CS1 is not available on the board, in MRAA the above
|
||||||
|
translates into five available bus numbers - from 0 to 4, covering SPI0CS0 to SPI1CS2.
|
||||||
|
|
||||||
Bus 0 (32765)
|
Pins listed are MRAA numbered pins. You will need the `spidev` kernel module loaded
|
||||||
MOSI = 4
|
with appropriate board configuration for binding, Ref-OS-IoT does not enable this by default.
|
||||||
MISO = 2
|
|
||||||
CS = 6
|
|
||||||
CLK = 10
|
|
||||||
|
|
||||||
Bus 1 (32766)
|
MRAA bus # | Ref-OS-IoT bus # | Joule docs bus # | MOSI | MISO | CLK | CS
|
||||||
MOSI = 67
|
-----------|------------------|------------------|------|------|-----|----
|
||||||
MISO = 69
|
0 | 32766 | SPI0 | 67 (J13-27)| 69 (J13-29) | 65 (J13-25) | 59 (J13-19)
|
||||||
CS0 = 59
|
1 | 32766 | SPI0 | 67 (J13-27)| 69 (J13-29) | 65 (J13-25) | 61 (J13-21)
|
||||||
CS1 = 61
|
2 | 32766 | SPI0 | 67 (J13-27)| 69 (J13-29) | 65 (J13-25) | 63 (J13-23)
|
||||||
CLK = 65
|
3 | 32765 | SPI1 | 4 (J12-4)| 2 (J12-2) | 10 (J12-10) | 6 (J12-6)
|
||||||
|
4 | 32765 | SPI1 | 4 (J12-4)| 2 (J12-2) | 10 (J12-10) | 8 (J12-8)
|
||||||
(remove 40 from numbers to get pin header number for pins on low speed header
|
|
||||||
2)
|
|
||||||
|
|
||||||
**UART** Some pins are labelled as UARTs but are not configured in BIOS as UART
|
**UART** Some pins are labelled as UARTs but are not configured in BIOS as UART
|
||||||
so only available UART is on the FTDI header. Disable the getty on ttyS2 and
|
so only available UART is on the FTDI header. Disable the getty on ttyS2 and
|
||||||
|
|||||||
@@ -136,14 +136,18 @@ mraa_joule_expansion_board()
|
|||||||
|
|
||||||
b->def_i2c_bus = b->i2c_bus[0].bus_id;
|
b->def_i2c_bus = b->i2c_bus[0].bus_id;
|
||||||
|
|
||||||
b->spi_bus_count = 3;
|
b->spi_bus_count = 5;
|
||||||
b->def_spi_bus = 0;
|
b->def_spi_bus = 0;
|
||||||
b->spi_bus[0].bus_id = 32765;
|
b->spi_bus[0].bus_id = 32766;
|
||||||
b->spi_bus[0].slave_s = 0;
|
b->spi_bus[0].slave_s = 0;
|
||||||
b->spi_bus[1].bus_id = 32766;
|
b->spi_bus[1].bus_id = 32766;
|
||||||
b->spi_bus[1].slave_s = 0;
|
b->spi_bus[1].slave_s = 1;
|
||||||
b->spi_bus[2].bus_id = 32766;
|
b->spi_bus[2].bus_id = 32766;
|
||||||
b->spi_bus[2].slave_s = 1;
|
b->spi_bus[2].slave_s = 2;
|
||||||
|
b->spi_bus[3].bus_id = 32765;
|
||||||
|
b->spi_bus[3].slave_s = 0;
|
||||||
|
b->spi_bus[4].bus_id = 32765;
|
||||||
|
b->spi_bus[4].slave_s = 2;
|
||||||
|
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user