summaryrefslogtreecommitdiff
path: root/include/spi.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/spi.h')
-rw-r--r--include/spi.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/spi.h b/include/spi.h
index f8f916213b..d62c1420ca 100644
--- a/include/spi.h
+++ b/include/spi.h
@@ -8,6 +8,25 @@
#ifndef __CROS_EC_SPI_H
#define __CROS_EC_SPI_H
+/*
+ * SPI Clock polarity and phase mode (0 - 3)
+ * @code
+ * clk mode | POL PHA
+ * ---------+--------
+ * 0 | 0 0
+ * 1 | 0 1
+ * 2 | 1 0
+ * 3 | 1 1
+ * ---------+--------
+ * @endcode
+ */
+enum spi_clock_mode {
+ SPI_CLOCK_MODE0 = 0,
+ SPI_CLOCK_MODE1 = 1,
+ SPI_CLOCK_MODE2 = 2,
+ SPI_CLOCK_MODE3 = 3
+};
+
/* Enable / disable the SPI port. When the port is disabled, all its I/O lines
* are high-Z so the EC won't interfere with other devices on the SPI bus. */
int spi_enable(int enable);