From ab9e7b19a6d2e51995a09e2818d384dac3b9ad0e Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 13 Jan 2025 19:42:13 +0000 Subject: [PATCH] Add MAX78000 into the build max78xxx_system Update wrapper files and add CMakeLists for MAX78000. Signed-off-by: Yasin Ustuner --- MAX/Include/wrap_max32_adc.h | 8 +- MAX/Include/wrap_max32_dma.h | 2 +- MAX/Include/wrap_max32_i2c.h | 11 +- MAX/Include/wrap_max32_lp.h | 7 +- MAX/Include/wrap_max32_owm.h | 6 +- MAX/Include/wrap_max32_spi.h | 15 +- MAX/Include/wrap_max32_sys.h | 12 +- MAX/Include/wrap_max32_tmr.h | 15 +- MAX/Include/wrap_max32_trng.h | 10 +- MAX/Include/wrap_max32_uart.h | 11 +- MAX/Include/wrap_max32_wdt.h | 10 +- .../PeriphDrivers/Include/MAX78000/i2c.h | 8 +- MAX/Source/MAX78000/CMakeLists.txt | 187 ++++++++++++++++++ MAX/Source/MAX78000/max78xxx_system.c | 28 +++ 14 files changed, 286 insertions(+), 44 deletions(-) create mode 100644 MAX/Source/MAX78000/CMakeLists.txt create mode 100644 MAX/Source/MAX78000/max78xxx_system.c diff --git a/MAX/Include/wrap_max32_adc.h b/MAX/Include/wrap_max32_adc.h index acd90ab..6868fea 100644 --- a/MAX/Include/wrap_max32_adc.h +++ b/MAX/Include/wrap_max32_adc.h @@ -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. @@ -51,10 +51,10 @@ 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) || (CONFIG_SOC_MAX32665) || (CONFIG_SOC_MAX32666) || \ - (CONFIG_SOC_MAX32680) +#if defined(CONFIG_SOC_MAX32655) || defined(CONFIG_SOC_MAX32665) || \ + 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 diff --git a/MAX/Include/wrap_max32_dma.h b/MAX/Include/wrap_max32_dma.h index fb3e7bd..8a70765 100644 --- a/MAX/Include/wrap_max32_dma.h +++ b/MAX/Include/wrap_max32_dma.h @@ -84,7 +84,7 @@ static inline int Wrap_MXC_DMA_DoTransfer(mxc_dma_regs_t *dma, mxc_dma_config_t */ #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_MAX78002) + (CONFIG_SOC_MAX32680) || (CONFIG_SOC_MAX78002) || (CONFIG_SOC_MAX78000) #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 diff --git a/MAX/Include/wrap_max32_i2c.h b/MAX/Include/wrap_max32_i2c.h index 00f7680..01680fb 100644 --- a/MAX/Include/wrap_max32_i2c.h +++ b/MAX/Include/wrap_max32_i2c.h @@ -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. @@ -128,9 +128,12 @@ static inline void Wrap_MXC_I2C_Stop(mxc_i2c_regs_t *i2c) /* * 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_MAX78002) +#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_MAX78000) + /* * Control register bits */ diff --git a/MAX/Include/wrap_max32_lp.h b/MAX/Include/wrap_max32_lp.h index 691eda9..c708c52 100644 --- a/MAX/Include/wrap_max32_lp.h +++ b/MAX/Include/wrap_max32_lp.h @@ -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. @@ -55,8 +55,9 @@ static inline void Wrap_MXC_LP_EnterPowerDownMode(void) /* * MAX32690, MAX32655 related mapping */ -#elif defined(CONFIG_SOC_MAX32690) || (CONFIG_SOC_MAX32655) || (CONFIG_SOC_MAX32680) || \ - (CONFIG_SOC_MAX78002) +#elif defined(CONFIG_SOC_MAX32690) || defined(CONFIG_SOC_MAX32655) || \ + defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX32657) || \ + defined(CONFIG_SOC_MAX78002) || defined(CONFIG_SOC_MAX78000) static inline void Wrap_MXC_LP_EnterLowPowerMode(void) { diff --git a/MAX/Include/wrap_max32_owm.h b/MAX/Include/wrap_max32_owm.h index 21d5528..3930797 100644 --- a/MAX/Include/wrap_max32_owm.h +++ b/MAX/Include/wrap_max32_owm.h @@ -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. @@ -40,8 +40,8 @@ static inline int Wrap_MXC_OWM_Init(const mxc_owm_cfg_t *cfg) /* * MAX32690, MAX32655 related mapping */ -#elif defined(CONFIG_SOC_MAX32690) || (CONFIG_SOC_MAX32655) || (CONFIG_SOC_MAX32680) || \ - (CONFIG_SOC_MAX78002) +#elif defined(CONFIG_SOC_MAX32690) || defined(CONFIG_SOC_MAX32655) || \ + 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) { diff --git a/MAX/Include/wrap_max32_spi.h b/MAX/Include/wrap_max32_spi.h index ad2656e..77a775f 100644 --- a/MAX/Include/wrap_max32_spi.h +++ b/MAX/Include/wrap_max32_spi.h @@ -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. @@ -73,10 +73,15 @@ static inline int Wrap_MXC_SPI_Init(mxc_spi_regs_t *spi, int masterMode, int qua /* * 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_MAX78002) - +#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_MAX78000) + +#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 #define ADI_MAX32_SPI_INT_FL_RX_UN MXC_F_SPI_INTFL_RX_UN diff --git a/MAX/Include/wrap_max32_sys.h b/MAX/Include/wrap_max32_sys.h index 68c1b48..cfc2b70 100644 --- a/MAX/Include/wrap_max32_sys.h +++ b/MAX/Include/wrap_max32_sys.h @@ -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. @@ -54,15 +54,17 @@ static inline void Wrap_MXC_SYS_SetClockDiv(int div) /* * 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_MAX78002) +#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_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 diff --git a/MAX/Include/wrap_max32_tmr.h b/MAX/Include/wrap_max32_tmr.h index f633771..6ec27e2 100644 --- a/MAX/Include/wrap_max32_tmr.h +++ b/MAX/Include/wrap_max32_tmr.h @@ -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. @@ -101,9 +101,11 @@ int Wrap_MXC_TMR_GetPendingInt(mxc_tmr_regs_t *tmr) /* * 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_MAX78002) +#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_MAX78000) #if defined(CONFIG_SOC_MAX32672) || (CONFIG_SOC_MAX32675) /* All timers are 32bits */ @@ -142,7 +144,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 @@ -150,7 +152,8 @@ static inline int Wrap_MXC_TMR_GetClockIndex(int z_clock) return MXC_TMR_32K_CLK; case 5: //ADI_MAX32_PRPH_CLK_SRC_INRO return MXC_TMR_INRO_CLK; -#if defined(CONFIG_SOC_MAX32690) || (CONFIG_SOC_MAX78002) +#if defined(CONFIG_SOC_MAX32655) || defined(CONFIG_SOC_MAX32680) || \ + 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 diff --git a/MAX/Include/wrap_max32_trng.h b/MAX/Include/wrap_max32_trng.h index 71e898d..6428341 100644 --- a/MAX/Include/wrap_max32_trng.h +++ b/MAX/Include/wrap_max32_trng.h @@ -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. @@ -44,9 +44,11 @@ static inline int Wrap_MXC_TRNG_RandomInt_NonBlocking(uint32_t *data) /* * 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_MAX78002) +#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_MAX78000) static inline int Wrap_MXC_TRNG_RandomInt_NonBlocking(uint32_t *data) { diff --git a/MAX/Include/wrap_max32_uart.h b/MAX/Include/wrap_max32_uart.h index 337d76b..0ca7af8 100644 --- a/MAX/Include/wrap_max32_uart.h +++ b/MAX/Include/wrap_max32_uart.h @@ -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. @@ -117,9 +117,12 @@ static inline void Wrap_MXC_UART_DisableRxDMA(mxc_uart_regs_t *uart) /* * 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_MAX78002) +#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_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 diff --git a/MAX/Include/wrap_max32_wdt.h b/MAX/Include/wrap_max32_wdt.h index 9fd2d00..cf3ef69 100644 --- a/MAX/Include/wrap_max32_wdt.h +++ b/MAX/Include/wrap_max32_wdt.h @@ -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. @@ -83,9 +83,11 @@ static inline int Wrap_MXC_WDT_SelectClockSource(mxc_wdt_regs_t *wdt, uint32_t c /* * 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_MAX78002) +#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_MAX78000) #define WRAP_MXC_F_WDT_CTRL_EN MXC_F_WDT_CTRL_EN diff --git a/MAX/Libraries/PeriphDrivers/Include/MAX78000/i2c.h b/MAX/Libraries/PeriphDrivers/Include/MAX78000/i2c.h index 7ccb00b..2a69353 100644 --- a/MAX/Libraries/PeriphDrivers/Include/MAX78000/i2c.h +++ b/MAX/Libraries/PeriphDrivers/Include/MAX78000/i2c.h @@ -7,7 +7,7 @@ * * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by * Analog Devices, Inc.), - * Copyright (C) 2023-2024 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. @@ -43,6 +43,12 @@ extern "C" { * @{ */ +/***** Definitions *****/ +#define MXC_I2C_STD_MODE 100000 +#define MXC_I2C_FAST_SPEED 400000 +#define MXC_I2C_FASTPLUS_SPEED 1000000 +#define MXC_I2C_HIGH_SPEED 3400000 + typedef struct _i2c_req_t mxc_i2c_req_t; /** * @brief The callback used by the MXC_I2C_ReadByteInteractive() function. diff --git a/MAX/Source/MAX78000/CMakeLists.txt b/MAX/Source/MAX78000/CMakeLists.txt new file mode 100644 index 0000000..33b7f42 --- /dev/null +++ b/MAX/Source/MAX78000/CMakeLists.txt @@ -0,0 +1,187 @@ +############################################################################## +# +# Copyright (C) 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. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +############################################################################## + + +if(NOT TARGET_REV) + # Default version A1, not actively use in driver but requires to be defined. + zephyr_compile_definitions(-DTARGET_REV=0x4131) +endif() + +zephyr_include_directories( + ${MSDK_PERIPH_SRC_DIR}/ADC + ${MSDK_PERIPH_SRC_DIR}/AES + ${MSDK_PERIPH_SRC_DIR}/CAMERAIF + ${MSDK_PERIPH_SRC_DIR}/CRC + ${MSDK_PERIPH_SRC_DIR}/DMA + ${MSDK_PERIPH_SRC_DIR}/FLC + ${MSDK_PERIPH_SRC_DIR}/GPIO + ${MSDK_PERIPH_SRC_DIR}/I2C + ${MSDK_PERIPH_SRC_DIR}/I2S + ${MSDK_PERIPH_SRC_DIR}/ICC + ${MSDK_PERIPH_SRC_DIR}/LP + ${MSDK_PERIPH_SRC_DIR}/LPCMP + ${MSDK_PERIPH_SRC_DIR}/OWM + ${MSDK_PERIPH_SRC_DIR}/PT + ${MSDK_PERIPH_SRC_DIR}/RTC + ${MSDK_PERIPH_SRC_DIR}/SEMA + ${MSDK_PERIPH_SRC_DIR}/SPI + ${MSDK_PERIPH_SRC_DIR}/SYS + ${MSDK_PERIPH_SRC_DIR}/TMR + ${MSDK_PERIPH_SRC_DIR}/TRNG + ${MSDK_PERIPH_SRC_DIR}/UART + ${MSDK_PERIPH_SRC_DIR}/WDT + ${MSDK_PERIPH_SRC_DIR}/WUT +) + +if(CONFIG_ARM) + zephyr_library_sources(${MSDK_CMSIS_DIR}/Source/system_max78000.c) + zephyr_library_sources(${MSDK_PERIPH_SRC_DIR}/SYS/mxc_lock.c) +elseif(CONFIG_RISCV) + zephyr_library_sources(${MSDK_CMSIS_DIR}/Source/system_riscv_max78000.c) +endif() + +zephyr_library_sources( + ./max78xxx_system.c + + ${MSDK_PERIPH_SRC_DIR}/CAMERAIF/cameraif_ai85.c + ${MSDK_PERIPH_SRC_DIR}/CAMERAIF/cameraif_reva.c + + ${MSDK_PERIPH_SRC_DIR}/ICC/icc_me17.c + ${MSDK_PERIPH_SRC_DIR}/ICC/icc_reva.c + + ${MSDK_PERIPH_SRC_DIR}/LP/lp_ai85.c + + ${MSDK_PERIPH_SRC_DIR}/LPCMP/lpcmp_ai85.c + ${MSDK_PERIPH_SRC_DIR}/LPCMP/lpcmp_reva.c + + ${MSDK_PERIPH_SRC_DIR}/SYS/mxc_assert.c + ${MSDK_PERIPH_SRC_DIR}/SYS/mxc_delay.c + ${MSDK_PERIPH_SRC_DIR}/SYS/pins_ai85.c + ${MSDK_PERIPH_SRC_DIR}/SYS/sys_ai85.c + + ${MSDK_PERIPH_SRC_DIR}/DMA/dma_me17.c + ${MSDK_PERIPH_SRC_DIR}/DMA/dma_reva.c + + ${MSDK_PERIPH_SRC_DIR}/SEMA/sema_me17.c + ${MSDK_PERIPH_SRC_DIR}/SEMA/sema_reva.c + + ${MSDK_PERIPH_SRC_DIR}/PT/pt_ai85.c + ${MSDK_PERIPH_SRC_DIR}/PT/pt_reva.c + + ${MSDK_PERIPH_SRC_DIR}/WUT/wut_ai85.c + ${MSDK_PERIPH_SRC_DIR}/WUT/wut_reva.c +) + +if (CONFIG_ADC_MAX32) +zephyr_library_sources( + ${MSDK_PERIPH_SRC_DIR}/ADC/adc_me17.c + ${MSDK_PERIPH_SRC_DIR}/ADC/adc_reva.c +) +endif() + +if (CONFIG_UART_MAX32) +zephyr_library_sources( + ${MSDK_PERIPH_SRC_DIR}/UART/uart_common.c + ${MSDK_PERIPH_SRC_DIR}/UART/uart_ai85.c + ${MSDK_PERIPH_SRC_DIR}/UART/uart_revb.c +) +endif() + +if (CONFIG_GPIO_MAX32) +zephyr_library_sources( + ${MSDK_PERIPH_SRC_DIR}/GPIO/gpio_common.c + ${MSDK_PERIPH_SRC_DIR}/GPIO/gpio_ai85.c + ${MSDK_PERIPH_SRC_DIR}/GPIO/gpio_reva.c +) +endif() + +if (CONFIG_SPI_MAX32) +zephyr_library_sources( + ${MSDK_PERIPH_SRC_DIR}/SPI/spi_me17.c + ${MSDK_PERIPH_SRC_DIR}/SPI/spi_reva1.c +) +endif() + +if (CONFIG_I2C_MAX32) +zephyr_library_sources( + ${MSDK_PERIPH_SRC_DIR}/I2C/i2c_me17.c + ${MSDK_PERIPH_SRC_DIR}/I2C/i2c_reva.c +) +endif() + +if (CONFIG_I2S_MAX32) +zephyr_library_sources( + ${MSDK_PERIPH_SRC_DIR}/I2S/i2s_ai85.c + ${MSDK_PERIPH_SRC_DIR}/I2S/i2s_reva.c +) +endif() + +if (CONFIG_WDT_MAX32) +zephyr_library_sources( + ${MSDK_PERIPH_SRC_DIR}/WDT/wdt_common.c + ${MSDK_PERIPH_SRC_DIR}/WDT/wdt_me17.c + ${MSDK_PERIPH_SRC_DIR}/WDT/wdt_revb.c +) +endif() + +if (CONFIG_RTC_MAX32 OR CONFIG_COUNTER_RTC_MAX32) +zephyr_library_sources( + ${MSDK_PERIPH_SRC_DIR}/RTC/rtc_me17.c + ${MSDK_PERIPH_SRC_DIR}/RTC/rtc_reva.c +) +endif() + +if (CONFIG_SOC_FLASH_MAX32 OR CONFIG_HWINFO_MAX32) +zephyr_library_sources( + ${MSDK_PERIPH_SRC_DIR}/FLC/flc_common.c + ${MSDK_PERIPH_SRC_DIR}/FLC/flc_me17.c + ${MSDK_PERIPH_SRC_DIR}/FLC/flc_reva.c +) +endif() + +if (CONFIG_PWM_MAX32 OR CONFIG_TIMER_MAX32 OR CONFIG_COUNTER_TIMER_MAX32) +zephyr_library_sources( + ${MSDK_PERIPH_SRC_DIR}/TMR/tmr_common.c + ${MSDK_PERIPH_SRC_DIR}/TMR/tmr_ai85.c + ${MSDK_PERIPH_SRC_DIR}/TMR/tmr_revb.c +) +endif() + +if (CONFIG_ENTROPY_MAX32_TRNG OR CONFIG_HWINFO_MAX32) +zephyr_library_sources( + ${MSDK_PERIPH_SRC_DIR}/TRNG/trng_ai85.c + ${MSDK_PERIPH_SRC_DIR}/TRNG/trng_revb.c +) +endif() + +if (CONFIG_CRYPTO_MAX32 OR CONFIG_HWINFO_MAX32) +zephyr_library_sources( + ${MSDK_PERIPH_SRC_DIR}/AES/aes_me17.c + ${MSDK_PERIPH_SRC_DIR}/AES/aes_revb.c + + ${MSDK_PERIPH_SRC_DIR}/CRC/crc_me17.c + ${MSDK_PERIPH_SRC_DIR}/CRC/crc_reva.c +) +endif() + +if (CONFIG_W1_MAX32) +zephyr_library_sources( + ${MSDK_PERIPH_SRC_DIR}/OWM/owm_me17.c + ${MSDK_PERIPH_SRC_DIR}/OWM/owm_reva.c +) +endif() diff --git a/MAX/Source/MAX78000/max78xxx_system.c b/MAX/Source/MAX78000/max78xxx_system.c new file mode 100644 index 0000000..ee009ca --- /dev/null +++ b/MAX/Source/MAX78000/max78xxx_system.c @@ -0,0 +1,28 @@ +/****************************************************************************** + * + * Copyright (C) 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************************/ + +#include "max78000.h" +#include "icc.h" + +/* + * This function is called during boot up. + */ +void max32xx_system_init(void) +{ + MXC_ICC_Enable(MXC_ICC0); +}