Skip to content

Commit

Permalink
Add MAX78000 into the build max78xxx_system
Browse files Browse the repository at this point in the history
Update wrapper files and add CMakeLists for MAX78000.

Signed-off-by: Yasin Ustuner <[email protected]>
  • Loading branch information
actions-user authored and yasin-ADI committed Jan 16, 2025
1 parent b1a1023 commit 87dd5d9
Show file tree
Hide file tree
Showing 15 changed files with 296 additions and 44 deletions.
9 changes: 5 additions & 4 deletions 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, 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
Expand Down
2 changes: 1 addition & 1 deletion MAX/Include/wrap_max32_dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions 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 @@ -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_MAX78002) || \
defined(CONFIG_SOC_MAX78000)

/*
* Control register bits
*/
Expand Down
7 changes: 4 additions & 3 deletions 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 @@ -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_MAX78002) || \
defined(CONFIG_SOC_MAX78000)

static inline void Wrap_MXC_LP_EnterLowPowerMode(void)
{
Expand Down
6 changes: 3 additions & 3 deletions 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 @@ -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)
{
Expand Down
10 changes: 6 additions & 4 deletions 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 @@ -73,9 +73,11 @@ 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_MAX78002) || \
defined(CONFIG_SOC_MAX78000)

#define ADI_MAX32_SPI_CTRL_MASTER_MODE MXC_F_SPI_CTRL0_MST_MODE

Expand Down
12 changes: 7 additions & 5 deletions 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 @@ -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_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
15 changes: 9 additions & 6 deletions 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 @@ -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_MAX78002) || \
defined(CONFIG_SOC_MAX78000)

#if defined(CONFIG_SOC_MAX32672) || (CONFIG_SOC_MAX32675)
/* All timers are 32bits */
Expand Down Expand Up @@ -142,15 +144,16 @@ 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
case 4: //ADI_MAX32_PRPH_CLK_SRC_ERTCO
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
Expand Down
10 changes: 6 additions & 4 deletions 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 @@ -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_MAX78002) || \
defined(CONFIG_SOC_MAX78000)

static inline int Wrap_MXC_TRNG_RandomInt_NonBlocking(uint32_t *data)
{
Expand Down
11 changes: 7 additions & 4 deletions 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 @@ -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_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
10 changes: 6 additions & 4 deletions 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 @@ -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_MAX78002) || \
defined(CONFIG_SOC_MAX78000)

#define WRAP_MXC_F_WDT_CTRL_EN MXC_F_WDT_CTRL_EN

Expand Down
8 changes: 7 additions & 1 deletion MAX/Libraries/PeriphDrivers/Include/MAX78000/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
14 changes: 13 additions & 1 deletion MAX/Libraries/PeriphDrivers/Include/MAX78000/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -654,6 +654,18 @@ void MXC_SPI_AbortAsync(mxc_spi_regs_t *spi);
* @param spi Pointer to SPI registers (selects the SPI block used.)
*/
void MXC_SPI_AsyncHandler(mxc_spi_regs_t *spi);

/**
* @brief Enable/Disable HW CS control feature.
*
* Depending on the application, the user might need to manually drive the slave select pin.
* The SPI driver automatically drives the SS pin and this function enables/disables this
* feature.
*
* @param spi Pointer to SPI registers (selects the SPI block used.)
* @param state Non-zero values: enable HW SS mode. Zero: disable HW SS mode.
*/
void MXC_SPI_HWSSControl(mxc_spi_regs_t *spi, int state);
/**@} end of group spi */

#ifdef __cplusplus
Expand Down
Loading

0 comments on commit 87dd5d9

Please sign in to comment.