diff --git a/firmware/common/w25q80bv_drv.c b/firmware/common/w25q80bv_drv.c index d0500b5d..1f55512f 100644 --- a/firmware/common/w25q80bv_drv.c +++ b/firmware/common/w25q80bv_drv.c @@ -30,6 +30,21 @@ #include #include +static void w25q80bv_spi_select(w25q80bv_hw_t* const hw) { + (void)hw; + gpio_clear(PORT_SSP0_SSEL, PIN_SSP0_SSEL); +} + +static void w25q80bv_spi_unselect(w25q80bv_hw_t* const hw) { + (void)hw; + gpio_set(PORT_SSP0_SSEL, PIN_SSP0_SSEL); +} + +static uint16_t w25q80bv_spi_transfer(w25q80bv_hw_t* const hw, const uint16_t tx_data) { + (void)hw; + return ssp_transfer(SSP0_NUM, tx_data); +} + void w25q80bv_spi_init(w25q80bv_hw_t* const hw) { const uint8_t serial_clock_rate = 2; const uint8_t clock_prescale_rate = 2; @@ -74,18 +89,3 @@ void w25q80bv_spi_init(w25q80bv_hw_t* const hw) { SSP_MASTER, SSP_SLAVE_OUT_ENABLE); } - -void w25q80bv_spi_select(w25q80bv_hw_t* const hw) { - (void)hw; - gpio_clear(PORT_SSP0_SSEL, PIN_SSP0_SSEL); -} - -void w25q80bv_spi_unselect(w25q80bv_hw_t* const hw) { - (void)hw; - gpio_set(PORT_SSP0_SSEL, PIN_SSP0_SSEL); -} - -uint16_t w25q80bv_spi_transfer(w25q80bv_hw_t* const hw, const uint16_t tx_data) { - (void)hw; - return ssp_transfer(SSP0_NUM, tx_data); -}