Skip to content

Commit

Permalink
chore(Other): Sync Libraries/zephyr folder (#1126)
Browse files Browse the repository at this point in the history
Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
  • Loading branch information
ozersa authored Aug 23, 2024
1 parent 94edd39 commit 71724ae
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 5 deletions.
20 changes: 18 additions & 2 deletions Libraries/zephyr/MAX/Include/wrap_max32_spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
7 changes: 6 additions & 1 deletion Libraries/zephyr/MAX/Include/wrap_max32_tmr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand All @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion Libraries/zephyr/MAX/Include/wrap_max32_uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
12 changes: 11 additions & 1 deletion Libraries/zephyr/MAX/Source/MAX32657/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 71724ae

Please sign in to comment.