arch: expand SPI API to handle slave mode of operation

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
1 files changed, 11 insertions(+), 0 deletions(-)

M arch/atmega48p_spi.h
M arch/atmega48p_spi.h +11 -0
@@ 118,6 118,17 @@ static inline void spi_init_master(enum 
 	__spi_init(mode, clock, bitorder, interrupt, true);
 }
 
+static inline void spi_init_slave(enum spi_mode mode,
+				  enum spi_bitorder bitorder,
+				  bool interrupt)
+{
+	/*
+	 * The clock divider setting doesn't matter.  The actual clock is
+	 * provided externally.
+	 */
+	__spi_init(mode, SPI_CLOCK_DIV4, bitorder, interrupt, false);
+}
+
 /* transmit a single byte, CS is left up to the caller */
 static inline void spi_tx_byte(uint8_t byte)
 {