X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=include%2Fspi.h;h=5cc6d6e0087fa5b00eff5d9489ff4838cf2e0a6a;hb=1e389a434aa9821330523002ee7b50d1147e0fef;hp=852f570eaa8d997c4fedd2c5b5dd8f5d7811746f;hpb=86e42b3629c212d98c7a17e36bd6c0702dcd864c;p=oweals%2Fu-boot.git diff --git a/include/spi.h b/include/spi.h index 852f570eaa..5cc6d6e008 100644 --- a/include/spi.h +++ b/include/spi.h @@ -10,6 +10,7 @@ #define _SPI_H_ #include +#include /* SPI mode flags */ #define SPI_CPHA BIT(0) /* clock phase */ @@ -66,6 +67,39 @@ struct dm_spi_slave_platdata { #endif /* CONFIG_DM_SPI */ +/** + * enum spi_clock_phase - indicates the clock phase to use for SPI (CPHA) + * + * @SPI_CLOCK_PHASE_FIRST: Data sampled on the first phase + * @SPI_CLOCK_PHASE_SECOND: Data sampled on the second phase + */ +enum spi_clock_phase { + SPI_CLOCK_PHASE_FIRST, + SPI_CLOCK_PHASE_SECOND, +}; + +/** + * enum spi_wire_mode - indicates the number of wires used for SPI + * + * @SPI_4_WIRE_MODE: Normal bidirectional mode with MOSI and MISO + * @SPI_3_WIRE_MODE: Unidirectional version with a single data line SISO + */ +enum spi_wire_mode { + SPI_4_WIRE_MODE, + SPI_3_WIRE_MODE, +}; + +/** + * enum spi_polarity - indicates the polarity of the SPI bus (CPOL) + * + * @SPI_POLARITY_LOW: Clock is low in idle state + * @SPI_POLARITY_HIGH: Clock is high in idle state + */ +enum spi_polarity { + SPI_POLARITY_LOW, + SPI_POLARITY_HIGH, +}; + /** * struct spi_slave - Representation of a SPI slave *