Skip to content

Commit

Permalink
Update Zephyr MSDK Hal based on MSDK PR: analogdevicesinc/msdk#1042
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user authored and ozersa committed Sep 11, 2024
1 parent 607bb5c commit 4af9237
Show file tree
Hide file tree
Showing 66 changed files with 7,945 additions and 1,823 deletions.
90 changes: 51 additions & 39 deletions MAX/Include/wrap_max32_dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
extern "C" {
#endif

/*
* MAX32665, MAX32666 related mapping
*/
#if defined(CONFIG_SOC_MAX32665) || (CONFIG_SOC_MAX32666)

#define ADI_MAX32_DMA_CTRL_DIS_IE MXC_F_DMA_CFG_CHDIEN
#define ADI_MAX32_DMA_CTRL_CTZIEN MXC_F_DMA_CFG_CTZIEN

Expand All @@ -36,7 +40,52 @@ extern "C" {
#define ADI_MAX32_DMA_STATUS_ST MXC_F_DMA_ST_CH_ST

#define ADI_MAX32_DMA_CFG_REQ_POS MXC_F_DMA_CFG_REQSEL_POS
#else

static inline int MXC_DMA_GetIntFlags(mxc_dma_regs_t *dma)
{
return dma->intr;
}

static inline int Wrap_MXC_DMA_Init(mxc_dma_regs_t *dma)
{
return MXC_DMA_Init(dma);
}

static inline void Wrap_MXC_DMA_DeInit(mxc_dma_regs_t *dma)
{
MXC_DMA_DeInit(dma);
}

static inline int Wrap_MXC_DMA_AcquireChannel(mxc_dma_regs_t *dma)
{
return MXC_DMA_AcquireChannel(dma);
}

static inline void Wrap_MXC_DMA_Handler(mxc_dma_regs_t *dma)
{
MXC_DMA_Handler(dma);
}

static inline int Wrap_MXC_DMA_MemCpy(mxc_dma_regs_t *dma, void *dest, void *src, int len,
mxc_dma_complete_cb_t callback)
{
return MXC_DMA_MemCpy(dma, dest, src, len, callback);
}

static inline int Wrap_MXC_DMA_DoTransfer(mxc_dma_regs_t *dma, mxc_dma_config_t config,
mxc_dma_srcdst_t firstSrcDst,
mxc_dma_trans_chain_t callback)
{
return MXC_DMA_DoTransfer(dma, config, firstSrcDst, callback);
}

/*
* MAX32690, MAX32655 related mapping
*/
#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)

#define ADI_MAX32_DMA_CTRL_DIS_IE MXC_F_DMA_CTRL_DIS_IE
#define ADI_MAX32_DMA_CTRL_CTZIEN MXC_F_DMA_CTRL_CTZ_IE

Expand All @@ -46,89 +95,52 @@ extern "C" {
#define ADI_MAX32_DMA_STATUS_ST MXC_F_DMA_STATUS_STATUS

#define ADI_MAX32_DMA_CFG_REQ_POS MXC_F_DMA_CTRL_REQUEST_POS
#endif

static inline int MXC_DMA_GetIntFlags(mxc_dma_regs_t *dma)
{
#if defined(CONFIG_SOC_MAX32665) || (CONFIG_SOC_MAX32666)
return dma->intr;
#else
return dma->intfl;
#endif
}

static inline int Wrap_MXC_DMA_Init(mxc_dma_regs_t *dma)
{
#if defined(CONFIG_SOC_MAX32657) || (CONFIG_SOC_MAX32665) || (CONFIG_SOC_MAX32666)
return MXC_DMA_Init(dma);
#else
(void)dma;
return MXC_DMA_Init();
#endif
}

static inline void Wrap_MXC_DMA_DeInit(mxc_dma_regs_t *dma)
{
#if defined(CONFIG_SOC_MAX32657) || (CONFIG_SOC_MAX32665) || (CONFIG_SOC_MAX32666)
MXC_DMA_DeInit(dma);
#else
(void)dma;
MXC_DMA_DeInit();
#endif
}

static inline int Wrap_MXC_DMA_AcquireChannel(mxc_dma_regs_t *dma)
{
#if defined(CONFIG_SOC_MAX32657) || (CONFIG_SOC_MAX32665) || (CONFIG_SOC_MAX32666)
return MXC_DMA_AcquireChannel(dma);
#else
(void)dma;
return MXC_DMA_AcquireChannel();
#endif
}

static inline void Wrap_MXC_DMA_Handler(mxc_dma_regs_t *dma)
{
#if defined(CONFIG_SOC_MAX32657) || (CONFIG_SOC_MAX32665) || (CONFIG_SOC_MAX32666)
MXC_DMA_Handler(dma);
#else
(void)dma;
MXC_DMA_Handler();
#endif
}

static inline int Wrap_MXC_DMA_MemCpy(mxc_dma_regs_t *dma, void *dest, void *src, int len,
mxc_dma_complete_cb_t callback)
{
#if defined(CONFIG_SOC_MAX32657) || (CONFIG_SOC_MAX32665) || (CONFIG_SOC_MAX32666)
return MXC_DMA_MemCpy(dma, dest, src, len, callback);
#else
(void)dma;
return MXC_DMA_MemCpy(dest, src, len, callback);
#endif
}

static inline int Wrap_MXC_DMA_DoTransfer(mxc_dma_regs_t *dma, mxc_dma_config_t config,
mxc_dma_srcdst_t firstSrcDst,
mxc_dma_trans_chain_t callback)
{
#if defined(CONFIG_SOC_MAX32657) || (CONFIG_SOC_MAX32665) || (CONFIG_SOC_MAX32666)
return MXC_DMA_DoTransfer(dma, config, firstSrcDst, callback);
#else
(void)dma;
return MXC_DMA_DoTransfer(config, firstSrcDst, callback);
#endif
}

static inline int Wrap_MXC_DMA_EnableInt(mxc_dma_regs_t *dma, int ch)
{
#if defined(CONFIG_SOC_MAX32657)
return MXC_DMA_EnableInt(dma, ch);
#else
(void)dma;
return MXC_DMA_EnableInt(ch);
#endif
}
#endif // part number

#ifdef __cplusplus
}
Expand Down
13 changes: 4 additions & 9 deletions 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 @@ -213,15 +217,6 @@ static inline void Wrap_MXC_UART_DisableRxDMA(mxc_uart_regs_t *uart)

#endif // defined(CONFIG_SOC_MAX32690) || (CONFIG_SOC_MAX32655)

static inline unsigned int Wrap_MXC_UART_GetRegINTEN(mxc_uart_regs_t *uart)
{
#if defined(CONFIG_SOC_MAX32662)
return uart->inten;
#else
return uart->int_en;
#endif
}

#ifdef __cplusplus
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ The libc implementation from GCC 11+ depends on _getpid and _kill in some places
There is no concept of processes/PIDs in the baremetal PeriphDrivers, therefore
we implement stub functions that return an error code to resolve linker warnings.
*/
__weak int _getpid(void)
int _getpid(void)
{
return E_NOT_SUPPORTED;
}

__weak int _kill(void)
int _kill(void)
{
return E_NOT_SUPPORTED;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ The libc implementation from GCC 11+ depends on _getpid and _kill in some places
There is no concept of processes/PIDs in the baremetal PeriphDrivers, therefore
we implement stub functions that return an error code to resolve linker warnings.
*/
__weak int _getpid(void)
int _getpid(void)
{
return E_NOT_SUPPORTED;
}

__weak int _kill(void)
int _kill(void)
{
return E_NOT_SUPPORTED;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ The libc implementation from GCC 11+ depends on _getpid and _kill in some places
There is no concept of processes/PIDs in the baremetal PeriphDrivers, therefore
we implement stub functions that return an error code to resolve linker warnings.
*/
__weak int _getpid(void)
int _getpid(void)
{
return E_NOT_SUPPORTED;
}

__weak int _kill(void)
int _kill(void)
{
return E_NOT_SUPPORTED;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ The libc implementation from GCC 11+ depends on _getpid and _kill in some places
There is no concept of processes/PIDs in the baremetal PeriphDrivers, therefore
we implement stub functions that return an error code to resolve linker warnings.
*/
__weak int _getpid(void)
int _getpid(void)
{
return E_NOT_SUPPORTED;
}

__weak int _kill(void)
int _kill(void)
{
return E_NOT_SUPPORTED;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ The libc implementation from GCC 11+ depends on _getpid and _kill in some places
There is no concept of processes/PIDs in the baremetal PeriphDrivers, therefore
we implement stub functions that return an error code to resolve linker warnings.
*/
__weak int _getpid(void)
int _getpid(void)
{
return E_NOT_SUPPORTED;
}

__weak int _kill(void)
int _kill(void)
{
return E_NOT_SUPPORTED;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ The libc implementation from GCC 11+ depends on _getpid and _kill in some places
There is no concept of processes/PIDs in the baremetal PeriphDrivers, therefore
we implement stub functions that return an error code to resolve linker warnings.
*/
__weak int _getpid(void)
int _getpid(void)
{
return E_NOT_SUPPORTED;
}

__weak int _kill(void)
int _kill(void)
{
return E_NOT_SUPPORTED;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ The libc implementation from GCC 11+ depends on _getpid and _kill in some places
There is no concept of processes/PIDs in the baremetal PeriphDrivers, therefore
we implement stub functions that return an error code to resolve linker warnings.
*/
__weak int _getpid(void)
int _getpid(void)
{
return E_NOT_SUPPORTED;
}

__weak int _kill(void)
int _kill(void)
{
return E_NOT_SUPPORTED;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ typedef struct {
__IO uint16_t datain16; /**< <tt>\b 0x0004:</tt> CRC DATAIN16 Register */
__IO uint8_t datain8; /**< <tt>\b 0x0004:</tt> CRC DATAIN8 Register */
};
__R uint8_t rsv_0x5_0x7[3];
__IO uint32_t poly; /**< <tt>\b 0x0008:</tt> CRC POLY Register */
__IO uint32_t val; /**< <tt>\b 0x000C:</tt> CRC VAL Register */
} mxc_crc_regs_t;
Expand Down
8 changes: 4 additions & 4 deletions MAX/Libraries/CMSIS/Device/Maxim/MAX32657/Include/fcr_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ typedef struct {
* @brief Register 0.
* @{
*/
#define MXC_F_FCR_FCTRL0_BTLELDO_TX_POS 0 /**< FCTRL0_BTLELDO_TX Position */
#define MXC_F_FCR_FCTRL0_BTLELDO_TX ((uint32_t)(0x1FUL << MXC_F_FCR_FCTRL0_BTLELDO_TX_POS)) /**< FCTRL0_BTLELDO_TX Mask */
#define MXC_F_FCR_FCTRL0_BTLELDO_RF_POS 0 /**< FCTRL0_BTLELDO_RF Position */
#define MXC_F_FCR_FCTRL0_BTLELDO_RF ((uint32_t)(0x1FUL << MXC_F_FCR_FCTRL0_BTLELDO_RF_POS)) /**< FCTRL0_BTLELDO_RF Mask */

#define MXC_F_FCR_FCTRL0_BTLELDO_RX_POS 8 /**< FCTRL0_BTLELDO_RX Position */
#define MXC_F_FCR_FCTRL0_BTLELDO_RX ((uint32_t)(0x1FUL << MXC_F_FCR_FCTRL0_BTLELDO_RX_POS)) /**< FCTRL0_BTLELDO_RX Mask */
#define MXC_F_FCR_FCTRL0_BTLELDO_BB_POS 8 /**< FCTRL0_BTLELDO_BB Position */
#define MXC_F_FCR_FCTRL0_BTLELDO_BB ((uint32_t)(0x1FUL << MXC_F_FCR_FCTRL0_BTLELDO_BB_POS)) /**< FCTRL0_BTLELDO_BB Mask */

#define MXC_F_FCR_FCTRL0_I3CDGEN0_POS 20 /**< FCTRL0_I3CDGEN0 Position */
#define MXC_F_FCR_FCTRL0_I3CDGEN0 ((uint32_t)(0x1UL << MXC_F_FCR_FCTRL0_I3CDGEN0_POS)) /**< FCTRL0_I3CDGEN0 Mask */
Expand Down
Loading

0 comments on commit 4af9237

Please sign in to comment.