# HG changeset patch # User Josef 'Jeff' Sipek # Date 1689382863 14400 # Fri Jul 14 21:01:03 2023 -0400 # Node ID bcc6efe49275c833b397f9116bea157e7d382c9e # Parent d5b2c4c9ce69b960582cc1ec9600a35b2c34d179 arch: expand SPI API to handle slave mode of operation Signed-off-by: Josef 'Jeff' Sipek diff --git a/arch/atmega48p_spi.h b/arch/atmega48p_spi.h --- a/arch/atmega48p_spi.h +++ b/arch/atmega48p_spi.h @@ -118,6 +118,17 @@ __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) {