Skip to content

Commit

Permalink
Add MAX78000 to Zephyr folder
Browse files Browse the repository at this point in the history
This commit adds MAX78000 SoC into
the zephyr build system

Signed-off-by: Yasin Ustuner <[email protected]>
  • Loading branch information
yasinustunerg authored and yasin-ADI committed Jan 13, 2025
1 parent 1cad008 commit f0ae38e
Show file tree
Hide file tree
Showing 12 changed files with 253 additions and 25 deletions.
7 changes: 4 additions & 3 deletions Libraries/zephyr/MAX/Include/wrap_max32_adc.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
*
* Copyright (C) 2023 Analog Devices, Inc.
* Copyright (C) 2023-2025 Analog Devices, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -51,10 +51,11 @@ typedef enum {
#define ADI_MAX32_ADC_REF_VDD_1_2 2

/*
* MAX32655, MAX32665, MAX32666 related mapping
* MAX32655, MAX32665, MAX32666, MAX32680, MAX78000 related mapping
*/
#if defined(CONFIG_SOC_MAX32655) || defined(CONFIG_SOC_MAX32665) || \
defined(CONFIG_SOC_MAX32666) || defined(CONFIG_SOC_MAX32680)
defined(CONFIG_SOC_MAX32666) || defined(CONFIG_SOC_MAX32680) || \
defined(CONFIG_SOC_MAX78000)

#define WRAP_MXC_F_ADC_CONV_DONE_IE MXC_F_ADC_INTR_DONE_IE
#define WRAP_MXC_F_ADC_CONV_DONE_IF MXC_F_ADC_INTR_DONE_IF
Expand Down
6 changes: 4 additions & 2 deletions Libraries/zephyr/MAX/Include/wrap_max32_i2c.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
*
* Copyright (C) 2023 Analog Devices, Inc.
* Copyright (C) 2023-2025 Analog Devices, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -131,7 +131,9 @@ static inline void Wrap_MXC_I2C_Stop(mxc_i2c_regs_t *i2c)
#elif defined(CONFIG_SOC_MAX32690) || defined(CONFIG_SOC_MAX32655) || \
defined(CONFIG_SOC_MAX32670) || defined(CONFIG_SOC_MAX32672) || \
defined(CONFIG_SOC_MAX32662) || defined(CONFIG_SOC_MAX32675) || \
defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX32657) || defined(CONFIG_SOC_MAX78002)
defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX32657) || \
defined(CONFIG_SOC_MAX78002) || defined(CONFIG_SOC_MAX78000)

/*
* Control register bits
*/
Expand Down
5 changes: 3 additions & 2 deletions Libraries/zephyr/MAX/Include/wrap_max32_lp.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
*
* Copyright (C) 2023 Analog Devices, Inc.
* Copyright (C) 2023-2025 Analog Devices, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -57,7 +57,8 @@ static inline void Wrap_MXC_LP_EnterPowerDownMode(void)
* MAX32690, MAX32655 related mapping
*/
#elif defined(CONFIG_SOC_MAX32690) || defined(CONFIG_SOC_MAX32655) || \
defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX32657) || defined(CONFIG_SOC_MAX78002)
defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX32657) || \
defined(CONFIG_SOC_MAX78002) || defined(CONFIG_SOC_MAX78000)

static inline void Wrap_MXC_LP_EnterLowPowerMode(void)
{
Expand Down
4 changes: 2 additions & 2 deletions Libraries/zephyr/MAX/Include/wrap_max32_owm.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
*
* Copyright (C) 2023 Analog Devices, Inc.
* Copyright (C) 2023-2025 Analog Devices, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -41,7 +41,7 @@ static inline int Wrap_MXC_OWM_Init(const mxc_owm_cfg_t *cfg)
* MAX32690, MAX32655 related mapping
*/
#elif defined(CONFIG_SOC_MAX32690) || defined(CONFIG_SOC_MAX32655) || \
defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX78002)
defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX78002) || defined(CONFIG_SOC_MAX78000)

static inline int Wrap_MXC_OWM_Init(const mxc_owm_cfg_t *cfg)
{
Expand Down
6 changes: 4 additions & 2 deletions Libraries/zephyr/MAX/Include/wrap_max32_spi.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
*
* Copyright (C) 2023 Analog Devices, Inc.
* Copyright (C) 2023-2025 Analog Devices, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -76,7 +76,9 @@ static inline int Wrap_MXC_SPI_Init(mxc_spi_regs_t *spi, int masterMode, int qua
#elif defined(CONFIG_SOC_MAX32690) || defined(CONFIG_SOC_MAX32655) || \
defined(CONFIG_SOC_MAX32670) || defined(CONFIG_SOC_MAX32672) || \
defined(CONFIG_SOC_MAX32662) || defined(CONFIG_SOC_MAX32675) || \
defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX32657) || defined(CONFIG_SOC_MAX78002)
defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX32657) || \
defined(CONFIG_SOC_MAX78002) || defined(CONFIG_SOC_MAX78000)

#if defined(CONFIG_SOC_MAX32657)
#define ADI_MAX32_SPI_CTRL_MASTER_MODE MXC_F_SPI_CTRL0_CONT_MODE
#else
Expand Down
7 changes: 4 additions & 3 deletions Libraries/zephyr/MAX/Include/wrap_max32_sys.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
*
* Copyright (C) 2023 Analog Devices, Inc.
* Copyright (C) 2023-2025 Analog Devices, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -57,13 +57,14 @@ static inline void Wrap_MXC_SYS_SetClockDiv(int div)
#elif defined(CONFIG_SOC_MAX32690) || defined(CONFIG_SOC_MAX32655) || \
defined(CONFIG_SOC_MAX32670) || defined(CONFIG_SOC_MAX32672) || \
defined(CONFIG_SOC_MAX32662) || defined(CONFIG_SOC_MAX32675) || \
defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX32657) || defined(CONFIG_SOC_MAX78002)
defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX32657) || \
defined(CONFIG_SOC_MAX78002) || defined(CONFIG_SOC_MAX78000)

#define ADI_MAX32_CLK_IPO MXC_SYS_CLOCK_IPO
#if defined(CONFIG_SOC_MAX78002)
#define ADI_MAX32_CLK_IPLL MXC_SYS_CLOCK_IPLL
#define ADI_MAX32_CLK_EBO MXC_SYS_CLOCK_EBO
#else
#elif !defined(CONFIG_SOC_MAX78000)
#define ADI_MAX32_CLK_ERFO MXC_SYS_CLOCK_ERFO
#endif
#define ADI_MAX32_CLK_IBRO MXC_SYS_CLOCK_IBRO
Expand Down
9 changes: 5 additions & 4 deletions Libraries/zephyr/MAX/Include/wrap_max32_tmr.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
*
* Copyright (C) 2023 Analog Devices, Inc.
* Copyright (C) 2023-2025 Analog Devices, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -104,7 +104,8 @@ int Wrap_MXC_TMR_GetPendingInt(mxc_tmr_regs_t *tmr)
#elif defined(CONFIG_SOC_MAX32690) || defined(CONFIG_SOC_MAX32655) || \
defined(CONFIG_SOC_MAX32670) || defined(CONFIG_SOC_MAX32672) || \
defined(CONFIG_SOC_MAX32662) || defined(CONFIG_SOC_MAX32675) || \
defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX32657) || defined(CONFIG_SOC_MAX78002)
defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX32657) || \
defined(CONFIG_SOC_MAX78002) || defined(CONFIG_SOC_MAX78000)

#if defined(CONFIG_SOC_MAX32672) || defined(CONFIG_SOC_MAX32675) || \
defined(CONFIG_SOC_MAX32657) || defined(CONFIG_SOC_MAX32670)
Expand Down Expand Up @@ -144,7 +145,7 @@ static inline int Wrap_MXC_TMR_GetClockIndex(int z_clock)
return MXC_TMR_EXT_CLK;
case 2: // ADI_MAX32_PRPH_CLK_SRC_IBRO
return MXC_TMR_8M_CLK;
#if !defined(CONFIG_SOC_MAX78002)
#if !defined(CONFIG_SOC_MAX78002) && !defined(CONFIG_SOC_MAX78000)
case 3: //ADI_MAX32_PRPH_CLK_SRC_ERFO
return MXC_TMR_32M_CLK;
#endif
Expand All @@ -153,7 +154,7 @@ static inline int Wrap_MXC_TMR_GetClockIndex(int z_clock)
case 5: //ADI_MAX32_PRPH_CLK_SRC_INRO
return MXC_TMR_INRO_CLK;
#if defined(CONFIG_SOC_MAX32655) || defined(CONFIG_SOC_MAX32680) || \
defined(CONFIG_SOC_MAX32690) || defined(CONFIG_SOC_MAX78002)
defined(CONFIG_SOC_MAX32690) || defined(CONFIG_SOC_MAX78002) || defined(CONFIG_SOC_MAX78000)
case 6: //ADI_MAX32_PRPH_CLK_SRC_ISO
return MXC_TMR_ISO_CLK;
#endif
Expand Down
5 changes: 3 additions & 2 deletions Libraries/zephyr/MAX/Include/wrap_max32_trng.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
*
* Copyright (C) 2023 Analog Devices, Inc.
* Copyright (C) 2023-2025 Analog Devices, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -47,7 +47,8 @@ static inline int Wrap_MXC_TRNG_RandomInt_NonBlocking(uint32_t *data)
#elif defined(CONFIG_SOC_MAX32690) || defined(CONFIG_SOC_MAX32655) || \
defined(CONFIG_SOC_MAX32670) || defined(CONFIG_SOC_MAX32672) || \
defined(CONFIG_SOC_MAX32662) || defined(CONFIG_SOC_MAX32675) || \
defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX32657) || defined(CONFIG_SOC_MAX78002)
defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX32657) || \
defined(CONFIG_SOC_MAX78002) || defined(CONFIG_SOC_MAX78000)

static inline int Wrap_MXC_TRNG_RandomInt_NonBlocking(uint32_t *data)
{
Expand Down
9 changes: 6 additions & 3 deletions Libraries/zephyr/MAX/Include/wrap_max32_uart.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
*
* Copyright (C) 2023 Analog Devices, Inc.
* Copyright (C) 2023-2025 Analog Devices, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -130,7 +130,9 @@ static inline void Wrap_MXC_UART_DisableRxDMA(mxc_uart_regs_t *uart)
#elif defined(CONFIG_SOC_MAX32690) || defined(CONFIG_SOC_MAX32655) || \
defined(CONFIG_SOC_MAX32670) || defined(CONFIG_SOC_MAX32672) || \
defined(CONFIG_SOC_MAX32662) || defined(CONFIG_SOC_MAX32675) || \
defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX32657) || defined(CONFIG_SOC_MAX78002)
defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX32657) || \
defined(CONFIG_SOC_MAX78002) || defined(CONFIG_SOC_MAX78000)

// status flags
#define ADI_MAX32_UART_RX_EMPTY MXC_F_UART_STATUS_RX_EM
#define ADI_MAX32_UART_TX_EMPTY MXC_F_UART_STATUS_TX_EM
Expand Down Expand Up @@ -214,7 +216,8 @@ static inline mxc_uart_clock_t wrap_get_clock_source_instance(int clock_source)
break;
#endif
#if defined(CONFIG_SOC_MAX32655) || defined(CONFIG_SOC_MAX32670) || \
defined(CONFIG_SOC_MAX32672) || defined(CONFIG_SOC_MAX32690) || defined(CONFIG_SOC_MAX78002)
defined(CONFIG_SOC_MAX32672) || defined(CONFIG_SOC_MAX32690) || \
defined(CONFIG_SOC_MAX78002) || defined(CONFIG_SOC_MAX78000)
case 4: // ADI_MAX32_PRPH_CLK_SRC_ERTCO
clk_src = MXC_UART_ERTCO_CLK;
break;
Expand Down
5 changes: 3 additions & 2 deletions Libraries/zephyr/MAX/Include/wrap_max32_wdt.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
*
* Copyright (C) 2023 Analog Devices, Inc.
* Copyright (C) 2023-2025 Analog Devices, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -86,7 +86,8 @@ static inline int Wrap_MXC_WDT_SelectClockSource(mxc_wdt_regs_t *wdt, uint32_t c
#elif defined(CONFIG_SOC_MAX32690) || defined(CONFIG_SOC_MAX32655) || \
defined(CONFIG_SOC_MAX32670) || defined(CONFIG_SOC_MAX32672) || \
defined(CONFIG_SOC_MAX32662) || defined(CONFIG_SOC_MAX32675) || \
defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX32657) || defined(CONFIG_SOC_MAX78002)
defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX32657) || \
defined(CONFIG_SOC_MAX78002) || defined(CONFIG_SOC_MAX78000)

#define WRAP_MXC_F_WDT_CTRL_EN MXC_F_WDT_CTRL_EN

Expand Down
Loading

0 comments on commit f0ae38e

Please sign in to comment.