spi
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
spi [ 04.02.2025 23:35] – [Modes] lars | spi [ 17.08.2025 05:52] (current) – removed lars | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== SPI ====== | ||
- | |||
- | Different variants exist. Usually SPI refers to the Motorola Serial Peripheral Interface. Other variants are the Texas Instruments Serial protocol (SSP) and the National Instruments Microwire. | ||
- | |||
- | |||
- | ===== Modes ===== | ||
- | There are 4 Modes. Defied by the two settings "clock polarity" | ||
- | |||
- | "clock polarity" | ||
- | - Clock line is low when idle. | ||
- | |||
- | "clock polarity" | ||
- | - Clock line is high when idle. | ||
- | |||
- | "clock phase" CPHA = 0: | ||
- | - first data bit is output on /CS activating (going low). | ||
- | - data bits change when clock goes to idle level. | ||
- | - data bits are read when clock comes from idle level. | ||
- | |||
- | "clock phase" CPHA = 1: | ||
- | - first data bit starts on first edge after /CS activates. | ||
- | - data bits change when clock comes from idle level. | ||
- | - data bits are read when clock goes to idle level. | ||
- | | ||
- | ^ mode ^ CPOL ^ CPHA ^ write bit ^ read bit ^ | ||
- | | 0 | 0 | 0 | clock goes low, and when /CS activates | ||
- | | 1 | 0 | 1 | clock goes high | clock goes low | | ||
- | | 2 | 1 | 0 | clock goes high, and when /CS activates | clock goes low | | ||
- | | 3 | 1 | 1 | clock goes low | clock goes high | | ||
- | |||
- | |||
- | ===== API ===== | ||
- | The part " | ||
- | |||
- | < | ||
- | void signal_name_transfer(const uint8_t *data_send, | ||
- | const uint8_t *data_receive, | ||
- | const uint32_t length )</ | ||
- | Will send " | ||
- | |||
spi.1738712156.txt.gz · Last modified: by lars