This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
products:sbc:common:applications:gpio:spi [2022/12/20 04:38] nick [Table] |
products:sbc:common:applications:gpio:spi [2023/11/07 05:07] nick [Enable SPI] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== SPI ====== | ||
- | ===== Introduction ===== | ||
- | SPI interface usage examples on [[products: | + | ===== SPI Reference table ===== |
- | ===== Reference table ===== | + | | |
- | + | ^ VIM3/ | |
- | | | + | | ::: | ::: |
- | ^ VIM3/ | + | | ::: | ::: |
- | | ::: | ::: | + | | ::: | ::: |
- | | ::: | ::: | + | ^ VIM4 |
- | | ::: | ::: | + | | ::: | ::: |
- | ^ VIM4 | + | | ::: | ::: |
- | | ::: | ::: | + | | ::: | ::: |
- | | ::: | ::: | + | ^ VIM1S | SPI_A | 29 | SPI_A_MOSI |
- | | ::: | ::: | + | | ::: | ::: |
- | ^ VIM1S | SPI_A | 29 | SPI_A_MOSI | + | | ::: | ::: |
- | | ::: | + | | ::: | ::: |
- | | ::: | + | |
- | | ::: | + | |
===== Enable SPI ===== | ===== Enable SPI ===== | ||
Line 45: | Line 41: | ||
/ | / | ||
``` | ``` | ||
+ | |||
+ | <tabbox VIM3 with 5.15 kernel> | ||
+ | |||
+ | Edit ''/ | ||
+ | |||
+ | |||
+ | e.g. Enable '' | ||
+ | |||
+ | ```shell | ||
+ | fdt_overlays=spi0 | ||
+ | |||
+ | ``` | ||
+ | |||
+ | After reboot, you will see the SPI device node. | ||
+ | |||
+ | <tabbox VIM3L with 5.15 kernel> | ||
+ | |||
+ | Edit ''/ | ||
+ | |||
+ | |||
+ | e.g. Enable '' | ||
+ | |||
+ | ```shell | ||
+ | fdt_overlays=spi0 | ||
+ | |||
+ | ``` | ||
+ | |||
+ | After reboot, you will see the SPI device node. | ||
<tabbox VIM4> | <tabbox VIM4> | ||
Line 125: | Line 149: | ||
} | } | ||
- | static const char *device = "/ | + | static const char *device = "/ |
static uint32_t mode; | static uint32_t mode; | ||
static uint8_t bits = 8; | static uint8_t bits = 8; | ||
Line 588: | Line 612: | ||
``` | ``` | ||
- | Run '' | + | Connect PIN36(MOSI), |
```shell | ```shell |