diff --git a/Libraries/zephyr/MAX/Include/wrap_max32_spi.h b/Libraries/zephyr/MAX/Include/wrap_max32_spi.h index ba0acfa4c81..a31a272507c 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_CONT_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_CONT_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_CONT_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 diff --git a/Libraries/zephyr/MAX/Include/wrap_max32_tmr.h b/Libraries/zephyr/MAX/Include/wrap_max32_tmr.h index 4c55c52a8d9..07163d1f522 100644 --- a/Libraries/zephyr/MAX/Include/wrap_max32_tmr.h +++ b/Libraries/zephyr/MAX/Include/wrap_max32_tmr.h @@ -105,7 +105,7 @@ int Wrap_MXC_TMR_GetPendingInt(mxc_tmr_regs_t *tmr) (CONFIG_SOC_MAX32672) || (CONFIG_SOC_MAX32662) || (CONFIG_SOC_MAX32675) || \ (CONFIG_SOC_MAX32680) || (CONFIG_SOC_MAX32657) -#if defined(CONFIG_SOC_MAX32672) || (CONFIG_SOC_MAX32675) +#if defined(CONFIG_SOC_MAX32672) || (CONFIG_SOC_MAX32675) || (CONFIG_SOC_MAX32657) /* All timers are 32bits */ #define WRAP_MXC_IS_32B_TIMER(idx) (1) #elif defined(CONFIG_SOC_MAX32662) @@ -159,6 +159,10 @@ static inline int Wrap_MXC_TMR_GetClockIndex(int z_clock) void Wrap_MXC_TMR_EnableWakeup(mxc_tmr_regs_t *tmr, wrap_mxc_tmr_cfg_t *cfg) { +#if defined(CONFIG_SOC_MAX32657) + (void)tmr; + (void)cfg; +#else mxc_tmr_cfg_t mxc_cfg; mxc_cfg.pres = cfg->pres; @@ -172,6 +176,7 @@ void Wrap_MXC_TMR_EnableWakeup(mxc_tmr_regs_t *tmr, wrap_mxc_tmr_cfg_t *cfg) MXC_LP_EnableTimerWakeup(tmr); // Enable Timer wake-up source MXC_TMR_EnableWakeup(tmr, &mxc_cfg); +#endif } void Wrap_MXC_TMR_ClearWakeupFlags(mxc_tmr_regs_t *tmr) diff --git a/Libraries/zephyr/MAX/Include/wrap_max32_uart.h b/Libraries/zephyr/MAX/Include/wrap_max32_uart.h index dd6907566b3..8991a03be9b 100644 --- a/Libraries/zephyr/MAX/Include/wrap_max32_uart.h +++ b/Libraries/zephyr/MAX/Include/wrap_max32_uart.h @@ -133,7 +133,11 @@ static inline void Wrap_MXC_UART_DisableRxDMA(mxc_uart_regs_t *uart) #define ADI_MAX32_UART_INT_OE MXC_F_UART_INTEN_RX_OV // Overrun Error Interrupt #define ADI_MAX32_UART_INT_PE MXC_F_UART_INTEN_RX_PAR // Parity Error Interrupt #define ADI_MAX32_UART_INT_FE MXC_F_UART_INTEN_RX_FERR // Framing Error Interrupt +#if defined(CONFIG_SOC_MAX32657) +#define ADI_MAX32_UART_INT_TX MXC_F_UART_INTEN_TX_THD // Transmit Interrupt +#else #define ADI_MAX32_UART_INT_TX MXC_F_UART_INTEN_TX_HE // Transmit Interrupt +#endif #define ADI_MAX32_UART_INT_RX MXC_F_UART_INTEN_RX_THD // Receive Interrupt #define ADI_MAX32_UART_INT_CTS MXC_F_UART_INTEN_CTS_EV // CTS Modem Interrupt #define ADI_MAX32_UART_INT_TX_OEM MXC_F_UART_INTEN_TX_OB // TX FIFO Almost Empty Interrupt @@ -215,7 +219,7 @@ static inline void Wrap_MXC_UART_DisableRxDMA(mxc_uart_regs_t *uart) static inline unsigned int Wrap_MXC_UART_GetRegINTEN(mxc_uart_regs_t *uart) { -#if defined(CONFIG_SOC_MAX32662) +#if defined(CONFIG_SOC_MAX32662) || (CONFIG_SOC_MAX32657) return uart->inten; #else return uart->int_en; diff --git a/Libraries/zephyr/MAX/Source/MAX32657/CMakeLists.txt b/Libraries/zephyr/MAX/Source/MAX32657/CMakeLists.txt index 26a4f27478a..9077c239633 100644 --- a/Libraries/zephyr/MAX/Source/MAX32657/CMakeLists.txt +++ b/Libraries/zephyr/MAX/Source/MAX32657/CMakeLists.txt @@ -22,6 +22,16 @@ if(NOT TARGET_REV) zephyr_compile_definitions(-DTARGET_REV=0x4131) endif() +math(EXPR __MXC_FLASH_MEM_SIZE "${CONFIG_FLASH_SIZE} * 1024") +math(EXPR __MXC_SRAM_MEM_SIZE "${CONFIG_SRAM_SIZE} * 1024") + +zephyr_compile_definitions( + -D__MXC_FLASH_MEM_BASE=${CONFIG_FLASH_BASE_ADDRESS} + -D__MXC_FLASH_MEM_SIZE=${__MXC_FLASH_MEM_SIZE} + -D__MXC_SRAM_MEM_BASE=${CONFIG_SRAM_BASE_ADDRESS} + -D__MXC_SRAM_MEM_SIZE=${__MXC_SRAM_MEM_SIZE} +) + zephyr_include_directories( ${MSDK_PERIPH_SRC_DIR}/SYS ${MSDK_PERIPH_SRC_DIR}/AES @@ -55,7 +65,7 @@ zephyr_library_sources( ${MSDK_PERIPH_SRC_DIR}/ICC/icc_me30.c ${MSDK_PERIPH_SRC_DIR}/ICC/icc_reva.c - #${MSDK_PERIPH_SRC_DIR}/LP/lp_me30.c + ${MSDK_PERIPH_SRC_DIR}/LP/lp_me30.c ${MSDK_PERIPH_SRC_DIR}/WUT/wut_me30.c ${MSDK_PERIPH_SRC_DIR}/WUT/wut_reva.c