From 8945a1ee40a7a40e142c2b4ea1b125db6bce4eb0 Mon Sep 17 00:00:00 2001 From: Mert Ekren Date: Tue, 11 Jun 2024 14:18:31 +0300 Subject: [PATCH] fix(PeriphDrivers): Fix zephyr wrapper build error SPI There are name changes in me30 for words "master, slave" to "controller, target". --- Libraries/zephyr/MAX/Include/wrap_max32_spi.h | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Libraries/zephyr/MAX/Include/wrap_max32_spi.h b/Libraries/zephyr/MAX/Include/wrap_max32_spi.h index ba0acfa4c8..e8af36157c 100644 --- a/Libraries/zephyr/MAX/Include/wrap_max32_spi.h +++ b/Libraries/zephyr/MAX/Include/wrap_max32_spi.h @@ -76,14 +76,20 @@ static inline int Wrap_MXC_SPI_Init(mxc_spi_regs_t *spi, int masterMode, int qua #elif defined(CONFIG_SOC_MAX32690) || (CONFIG_SOC_MAX32655) || (CONFIG_SOC_MAX32670) || \ (CONFIG_SOC_MAX32672) || (CONFIG_SOC_MAX32662) || (CONFIG_SOC_MAX32675) || \ (CONFIG_SOC_MAX32680) || (CONFIG_SOC_MAX32657) - +#if defined(CONFIG_SOC_MAX32657) +#define ADI_MAX32_SPI_CTRL_MASTER_MODE MXC_F_SPI_CTRL0_CTRLR_MODE +#else #define ADI_MAX32_SPI_CTRL_MASTER_MODE MXC_F_SPI_CTRL0_MST_MODE - +#endif #define ADI_MAX32_SPI_INT_FL_RX_UN MXC_F_SPI_INTFL_RX_UN #define ADI_MAX32_SPI_INT_FL_RX_OV MXC_F_SPI_INTFL_RX_OV #define ADI_MAX32_SPI_INT_FL_TX_UN MXC_F_SPI_INTFL_TX_UN #define ADI_MAX32_SPI_INT_FL_TX_OV MXC_F_SPI_INTFL_TX_OV +#if defined(CONFIG_SOC_MAX32657) +#define ADI_MAX32_SPI_INT_FL_MST_DONE MXC_F_SPI_INTFL_CTRLR_DONE +#else #define ADI_MAX32_SPI_INT_FL_MST_DONE MXC_F_SPI_INTFL_MST_DONE +#endif #define ADI_MAX32_SPI_INT_FL_ABORT MXC_F_SPI_INTFL_ABORT #define ADI_MAX32_SPI_INT_FL_FAULT MXC_F_SPI_INTFL_FAULT #define ADI_MAX32_SPI_INT_FL_SSD MXC_F_SPI_INTFL_SSD @@ -96,7 +102,11 @@ static inline int Wrap_MXC_SPI_Init(mxc_spi_regs_t *spi, int masterMode, int qua #define ADI_MAX32_SPI_INT_EN_RX_OV MXC_F_SPI_INTEN_RX_OV #define ADI_MAX32_SPI_INT_EN_TX_UN MXC_F_SPI_INTEN_TX_UN #define ADI_MAX32_SPI_INT_EN_TX_OV MXC_F_SPI_INTEN_TX_OV +#if defined(CONFIG_SOC_MAX32657) +#define ADI_MAX32_SPI_INT_EN_MST_DONE MXC_F_SPI_INTEN_CTRLR_DONE +#else #define ADI_MAX32_SPI_INT_EN_MST_DONE MXC_F_SPI_INTEN_MST_DONE +#endif #define ADI_MAX32_SPI_INT_EN_ABORT MXC_F_SPI_INTEN_ABORT #define ADI_MAX32_SPI_INT_EN_FAULT MXC_F_SPI_INTEN_FAULT #define ADI_MAX32_SPI_INT_EN_SSD MXC_F_SPI_INTEN_SSD @@ -123,6 +133,12 @@ static inline int Wrap_MXC_SPI_Init(mxc_spi_regs_t *spi, int masterMode, int qua #endif // part number +#if defined(CONFIG_SOC_MAX32657) +#define ADI_MAX32_SPI_CTRL0_SS_CTRL MXC_F_SPI_CTRL0_TS_CTRL +#else +#define ADI_MAX32_SPI_CTRL0_SS_CTRL MXC_F_SPI_CTRL0_SS_CTRL +#endif + #ifdef __cplusplus } #endif