From 797db077355b664be8b77bb5cd1e22c4424c3e44 Mon Sep 17 00:00:00 2001 From: Furkan Akkiz Date: Mon, 21 Oct 2024 17:17:45 +0300 Subject: [PATCH] Add 'MXC_SPI_HWSSControl' function Add 'MXC_SPI_HWSSControl' function for AI87. Signed-off-by: Furkan Akkiz --- MAX/Libraries/PeriphDrivers/Include/MAX78002/spi.h | 12 ++++++++++++ MAX/Libraries/PeriphDrivers/Source/SPI/spi_ai87.c | 5 +++++ MAX/Libraries/PeriphDrivers/Source/SPI/spi_ai87_v2.c | 5 +++++ 3 files changed, 22 insertions(+) diff --git a/MAX/Libraries/PeriphDrivers/Include/MAX78002/spi.h b/MAX/Libraries/PeriphDrivers/Include/MAX78002/spi.h index 4d99415..0bff976 100644 --- a/MAX/Libraries/PeriphDrivers/Include/MAX78002/spi.h +++ b/MAX/Libraries/PeriphDrivers/Include/MAX78002/spi.h @@ -707,6 +707,18 @@ unsigned int MXC_SPI_ReadRXFIFO(mxc_spi_regs_t *spi, unsigned char *bytes, unsig * @return Success/Fail, see \ref MXC_Error_Codes for a list of return codes. */ int MXC_SPI_SetDefaultTXData(mxc_spi_regs_t *spi, unsigned int defaultTXData); + +/** + * @brief Enable/Disable HW CS control feature. + * + * Depending on the application, the user might need to manually drive the slave select pin. + * The SPI driver automatically drives the SS pin and this function enables/disables this + * feature. + * + * @param spi Pointer to SPI registers (selects the SPI block used.) + * @param state Non-zero values: enable HW SS mode. Zero: disable HW SS mode. + */ +void MXC_SPI_HWSSControl(mxc_spi_regs_t *spi, int state); //////<<< Previous Implementation /* ** DMA Functions ** */ diff --git a/MAX/Libraries/PeriphDrivers/Source/SPI/spi_ai87.c b/MAX/Libraries/PeriphDrivers/Source/SPI/spi_ai87.c index 9d1ce7b..ec4de46 100644 --- a/MAX/Libraries/PeriphDrivers/Source/SPI/spi_ai87.c +++ b/MAX/Libraries/PeriphDrivers/Source/SPI/spi_ai87.c @@ -508,6 +508,11 @@ void MXC_SPI_AsyncHandler(mxc_spi_regs_t *spi) MXC_SPI_RevA1_AsyncHandler((mxc_spi_reva_regs_t *)spi); } +void MXC_SPI_HWSSControl(mxc_spi_regs_t *spi, int state) +{ + MXC_SPI_RevA1_HWSSControl((mxc_spi_reva_regs_t *)spi, state); +} + /* ** SPI v2 functions to prevent build errors ** */ int MXC_SPI_Config(mxc_spi_cfg_t *cfg) diff --git a/MAX/Libraries/PeriphDrivers/Source/SPI/spi_ai87_v2.c b/MAX/Libraries/PeriphDrivers/Source/SPI/spi_ai87_v2.c index d6e778a..b04c975 100644 --- a/MAX/Libraries/PeriphDrivers/Source/SPI/spi_ai87_v2.c +++ b/MAX/Libraries/PeriphDrivers/Source/SPI/spi_ai87_v2.c @@ -812,3 +812,8 @@ int MXC_SPI_SetDefaultTXData(mxc_spi_regs_t *spi, unsigned int defaultTXData) { return MXC_SPI_RevA2_SetDummyTX((mxc_spi_reva_regs_t *)spi, defaultTXData); } + +void MXC_SPI_HWSSControl(mxc_spi_regs_t *spi, int state) +{ + MXC_ASSERT(0); +}