From ed4479283fc18bf7919028e8fcc384774685a58e Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Wed, 23 Oct 2024 11:42:39 -0500 Subject: [PATCH 01/28] added basic api for get package and date code --- .../PeriphDrivers/Include/MAX32655/mxc_sys.h | 14 ++ .../PeriphDrivers/Source/SYS/sys_common.c | 123 ++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 Libraries/PeriphDrivers/Source/SYS/sys_common.c diff --git a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h index c6227c9fe7f..91f55ade37a 100644 --- a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h @@ -185,6 +185,20 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; +typedef enum +{ + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +}mxc_sys_package_type_t; + +typedef struct +{ + uint8_t day, month, year; +}mxc_sys_date_t; + + #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum diff --git a/Libraries/PeriphDrivers/Source/SYS/sys_common.c b/Libraries/PeriphDrivers/Source/SYS/sys_common.c new file mode 100644 index 00000000000..0022ca074df --- /dev/null +++ b/Libraries/PeriphDrivers/Source/SYS/sys_common.c @@ -0,0 +1,123 @@ +/****************************************************************************** + * + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Analog Devices, Inc.), + * Copyright (C) 2023-2024 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. + * + ******************************************************************************/ + +/** + * @file mxc_sys.c + * @brief System layer driver. + * @details This driver is used to control the system layer of the device. + */ + +/* **** Includes **** */ +#include +#include "mxc_device.h" +#include "mxc_assert.h" +#include "mxc_sys.h" +#include "flc.h" +#include "mxc_delay.h" +#include "gcr_regs.h" +#include "fcr_regs.h" +#include "mcr_regs.h" + +/** + * @ingroup mxc_sys + * @{ + */ + +/* **** Definitions **** */ +#define DAY_CODE_OFFSET 0x14 +#define MONTH_CODE_OFFSET 0x15 +#define YEAR_CODE_OFFSET 0x16 +#define PKG_CODE_OFFSET 0x17 +#define REG8_VAL(addr) (*(volatile uint8_t *)(MXC_INFO_MEM_BASE + addr)) +/* **** Globals **** */ +static mxc_sys_package_type_t pkg_type = MXC_SYS_PKG_UNSET; +/* **** Functions **** */ +/* ************************************************************************** */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void) +{ + if(pkg_type != MXC_SYS_PKG_UNSET) + { + return pkg_type; + } + + + MXC_FLC_UnlockInfoBlock(MXC_INFO_MEM_BASE); + + mxc_sys_date_t date_info; + MXC_SYS_GetTestDate(&date_info); + + // Package codes were only introduced when test date was + mxc_sys_date_t date; + int err = MXC_SYS_GetTestDate(&date); + + if(err != E_NO_ERROR) + { + pkg_type = MXC_SYS_PKG_UNSET; + } + else + { + const uint8_t maybe_pkg_type = REG8_VAL(PKG_CODE_OFFSET); + int err = MXC_SYS_SetPackageType(maybe_pkg_type); + MXC_ASSET(err == E_NO_ERROR); + } + + + + MXC_FLC_LockInfoBlock(MXC_INFO_MEM_BASE); + + return pkg_type; +} +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type) +{ + switch(new_pkg_type) + { + case MXC_SYS_PKG_TQFN: + case MXC_SYS_PKG_BGA: + case MXC_SYS_PKG_WLP: + case MXC_SYS_PKG_UNSET: + pkg_type = new_pkg_type; + return E_NO_ERROR; + default: + return E_BAD_PARAM; + } +} + + +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info) +{ + MXC_ASSERT(date_info); + + date_info->day = REG8_VAL(DAY_CODE_OFFSET); + date_info->month = REG8_VAL(MONTH_CODE_OFFSET); + date_info->year = REG8_VAL(YEAR_CODE_OFFSET); + + // Flash is cleared if not valid + // Sorry dev in 2255 + if(date_info->year == 0xff || date_info->month == 0xff || date_info->day == 0xff) + { + return E_INVALID; + } + + + return E_NO_ERROR; + +} + +/**@} end of mxc_sys */ From dd1330db9ac4bf216d6525a43d459fecba737f45 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Thu, 24 Oct 2024 10:09:12 -0500 Subject: [PATCH 02/28] added common c files to libPeriphDriver.mk --- .../PeriphDrivers/Include/MAX32655/mxc_sys.h | 4 +++- Libraries/PeriphDrivers/Source/SYS/sys_common.c | 15 ++++++++++----- Libraries/PeriphDrivers/libPeriphDriver.mk | 5 +++++ Libraries/PeriphDrivers/max32655_files.mk | 6 +----- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h index 91f55ade37a..130fe8a7227 100644 --- a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h @@ -313,7 +313,9 @@ static inline int MXC_SYS_In_Crit_Section(void) * @returns E_NO_ERROR if everything is successful. */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); - +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); /** * @brief Gets design revision of the chip. * diff --git a/Libraries/PeriphDrivers/Source/SYS/sys_common.c b/Libraries/PeriphDrivers/Source/SYS/sys_common.c index 0022ca074df..85c14591255 100644 --- a/Libraries/PeriphDrivers/Source/SYS/sys_common.c +++ b/Libraries/PeriphDrivers/Source/SYS/sys_common.c @@ -35,6 +35,7 @@ #include "fcr_regs.h" #include "mcr_regs.h" + /** * @ingroup mxc_sys * @{ @@ -45,10 +46,14 @@ #define MONTH_CODE_OFFSET 0x15 #define YEAR_CODE_OFFSET 0x16 #define PKG_CODE_OFFSET 0x17 + #define REG8_VAL(addr) (*(volatile uint8_t *)(MXC_INFO_MEM_BASE + addr)) + /* **** Globals **** */ static mxc_sys_package_type_t pkg_type = MXC_SYS_PKG_UNSET; + /* **** Functions **** */ + /* ************************************************************************** */ mxc_sys_package_type_t MXC_SYS_GetPackageType(void) { @@ -57,14 +62,14 @@ mxc_sys_package_type_t MXC_SYS_GetPackageType(void) return pkg_type; } + mxc_sys_date_t date; + mxc_sys_date_t date_info; MXC_FLC_UnlockInfoBlock(MXC_INFO_MEM_BASE); - mxc_sys_date_t date_info; MXC_SYS_GetTestDate(&date_info); // Package codes were only introduced when test date was - mxc_sys_date_t date; int err = MXC_SYS_GetTestDate(&date); if(err != E_NO_ERROR) @@ -75,7 +80,7 @@ mxc_sys_package_type_t MXC_SYS_GetPackageType(void) { const uint8_t maybe_pkg_type = REG8_VAL(PKG_CODE_OFFSET); int err = MXC_SYS_SetPackageType(maybe_pkg_type); - MXC_ASSET(err == E_NO_ERROR); + MXC_ASSERT(err == E_NO_ERROR); } @@ -109,8 +114,8 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info) date_info->year = REG8_VAL(YEAR_CODE_OFFSET); // Flash is cleared if not valid - // Sorry dev in 2255 - if(date_info->year == 0xff || date_info->month == 0xff || date_info->day == 0xff) + // Year 2255 is valid + if(date_info->month > 12 || date_info->day > 31) { return E_INVALID; } diff --git a/Libraries/PeriphDrivers/libPeriphDriver.mk b/Libraries/PeriphDrivers/libPeriphDriver.mk index 4ebba45947e..b4bd63a70ca 100644 --- a/Libraries/PeriphDrivers/libPeriphDriver.mk +++ b/Libraries/PeriphDrivers/libPeriphDriver.mk @@ -60,6 +60,11 @@ CMSIS_ROOT=../CMSIS endif include ${CMSIS_ROOT}/../PeriphDrivers/$(TARGET_LC)_files.mk +PERIPH_DRIVER_C_FILES += $(PERIPH_DIR)/Source/SYS/mxc_assert.c +PERIPH_DRIVER_C_FILES += $(PERIPH_DIR)/Source/SYS/mxc_delay.c +PERIPH_DRIVER_C_FILES += $(PERIPH_DIR)/Source/SYS/mxc_lock.c +PERIPH_DRIVER_C_FILES += $(PERIPH_DIR)/Source/SYS/nvic_table.c +PERIPH_DRIVER_C_FILES += $(PERIPH_DIR)/Source/SYS/sys_common.c # # Where to find header files for this project IPATH += $(PERIPH_DRIVER_INCLUDE_DIR) diff --git a/Libraries/PeriphDrivers/max32655_files.mk b/Libraries/PeriphDrivers/max32655_files.mk index b3f2e9ef953..55a581c0272 100644 --- a/Libraries/PeriphDrivers/max32655_files.mk +++ b/Libraries/PeriphDrivers/max32655_files.mk @@ -49,13 +49,10 @@ PERIPH_DRIVER_INCLUDE_DIR += $(INCLUDE_DIR)/$(TARGET_UC)/ PINS_FILE ?= $(SOURCE_DIR)/SYS/pins_me17.c # Source files -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_assert.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_delay.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_lock.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/nvic_table.c PERIPH_DRIVER_C_FILES += $(PINS_FILE) PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/sys_me17.c + PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/ADC PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/ADC/adc_me17.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/ADC/adc_reva.c @@ -147,4 +144,3 @@ PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/WDT/wdt_revb.c PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/WUT PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/WUT/wut_me17.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/WUT/wut_reva.c - From 8dc43d3927855216666fee8e690cdd304a57b1d7 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Fri, 25 Oct 2024 09:33:13 -0500 Subject: [PATCH 03/28] added common package info functons and structs to all parts --- .../PeriphDrivers/Include/MAX32520/mxc_sys.h | 30 ++++++++++++ .../PeriphDrivers/Include/MAX32570/mxc_sys.h | 31 ++++++++++++ .../PeriphDrivers/Include/MAX32650/mxc_sys.h | 31 ++++++++++++ .../PeriphDrivers/Include/MAX32655/mxc_sys.h | 14 ++++++ .../PeriphDrivers/Include/MAX32657/mxc_sys.h | 31 ++++++++++++ .../PeriphDrivers/Include/MAX32660/mxc_sys.h | 31 ++++++++++++ .../PeriphDrivers/Include/MAX32662/mxc_sys.h | 31 ++++++++++++ .../PeriphDrivers/Include/MAX32665/mxc_sys.h | 31 ++++++++++++ .../PeriphDrivers/Include/MAX32670/mxc_sys.h | 31 ++++++++++++ .../PeriphDrivers/Include/MAX32672/mxc_sys.h | 31 ++++++++++++ .../PeriphDrivers/Include/MAX32675/mxc_sys.h | 31 +++++++++++- .../PeriphDrivers/Include/MAX32680/mxc_sys.h | 48 ++++++++++++++++++- .../PeriphDrivers/Include/MAX32690/mxc_sys.h | 32 ++++++++++++- .../PeriphDrivers/Include/MAX78000/mxc_sys.h | 31 +++++++++++- .../PeriphDrivers/Include/MAX78002/mxc_sys.h | 31 +++++++++++- 15 files changed, 460 insertions(+), 5 deletions(-) diff --git a/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys.h index 14a2d860593..1358ed49eef 100644 --- a/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys.h @@ -120,6 +120,18 @@ typedef enum { MXC_SYS_CLOCK_DIV_64 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV64, MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; +typedef enum +{ + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +}mxc_sys_package_type_t; + +typedef struct +{ + uint8_t day, month, year; +}mxc_sys_date_t; #define MXC_SYS_SCACHE_CLK 1 // Enable SCACHE CLK #define MXC_SYS_CTB_CLK 1 // Enable CTB CLK @@ -318,6 +330,24 @@ uint8_t MXC_SYS_GetRev(void); */ int MXC_SYS_GetUSN(uint8_t *serialNumber, int len); +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + /** * @brief This function PERMANENTLY locks the Debug Access Port. * diff --git a/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys.h index 44321547828..fbdb4e231c1 100644 --- a/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys.h @@ -234,6 +234,19 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; +typedef enum +{ + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +}mxc_sys_package_type_t; + +typedef struct +{ + uint8_t day, month, year; +}mxc_sys_date_t; + #define MXC_SYS_SCACHE_CLK 1 // Enable SCACHE CLK #define MXC_SYS_CTB_CLK 1 // Enable CTB CLK @@ -431,6 +444,24 @@ uint8_t MXC_SYS_GetRev(void); */ int MXC_SYS_GetUSN(uint8_t *serialNumber, int len); +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + /** * @brief This function PERMANENTLY locks the Debug Access Port. * diff --git a/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys.h index 35ae798f413..65b17c9a150 100644 --- a/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys.h @@ -205,6 +205,19 @@ typedef enum { MXC_SYS_SYSTEM_DIV_128 = MXC_S_GCR_CLK_CTRL_SYSCLK_PRESCALE_DIV128, } mxc_sys_system_div_t; +typedef enum +{ + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +}mxc_sys_package_type_t; + +typedef struct +{ + uint8_t day, month, year; +}mxc_sys_date_t; + typedef struct { uint8_t scache_flag; uint8_t crypto_flag; @@ -421,6 +434,24 @@ uint8_t MXC_SYS_GetRev(void); */ int MXC_SYS_GetUSN(uint8_t *serialNumber, int len); +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + /** * @brief System level initialization for SCHACE module. * @param sys_cfg System configuration object diff --git a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h index 130fe8a7227..9993b908c74 100644 --- a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h @@ -313,8 +313,22 @@ static inline int MXC_SYS_In_Crit_Section(void) * @returns E_NO_ERROR if everything is successful. */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); /** * @brief Gets design revision of the chip. diff --git a/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys.h index a763886da73..eccd5fa638e 100644 --- a/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys.h @@ -116,6 +116,19 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; +typedef enum +{ + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +}mxc_sys_package_type_t; + +typedef struct +{ + uint8_t day, month, year; +}mxc_sys_date_t; + #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -231,6 +244,24 @@ static inline int MXC_SYS_In_Crit_Section(void) */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. diff --git a/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys.h index ed3e2062bd6..857f7c114b3 100644 --- a/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys.h @@ -111,6 +111,19 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLK_CTRL_PSC_DIV128 } mxc_sys_system_clock_div_t; +typedef enum +{ + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +}mxc_sys_package_type_t; + +typedef struct +{ + uint8_t day, month, year; +}mxc_sys_date_t; + #define MXC_SYS_USN_LEN 8 /***** Function Prototypes *****/ @@ -225,6 +238,24 @@ static inline int MXC_SYS_In_Crit_Section(void) */ int MXC_SYS_GetUSN(uint8_t *usn, int len, int part); +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. diff --git a/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys.h index a483bd94dea..cf483622a95 100644 --- a/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys.h @@ -141,6 +141,19 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; +typedef enum +{ + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +}mxc_sys_package_type_t; + +typedef struct +{ + uint8_t day, month, year; +}mxc_sys_date_t; + #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -256,6 +269,24 @@ static inline int MXC_SYS_In_Crit_Section(void) */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. diff --git a/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys.h index 274fc132eed..736b5f460f5 100644 --- a/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys.h @@ -196,6 +196,19 @@ typedef enum { MXC_SYS_CLOCK_XTAL32K = MXC_V_GCR_CLKCN_CLKSEL_XTAL32K, } mxc_sys_system_clock_t; +typedef enum +{ + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +}mxc_sys_package_type_t; + +typedef struct +{ + uint8_t day, month, year; +}mxc_sys_date_t; + #define MXC_SYS_SCACHE_CLK 1 // Enable SCACHE CLK #define MXC_SYS_CTB_CLK 1 // Enable CTB CLK @@ -314,6 +327,24 @@ static inline int MXC_SYS_In_Crit_Section(void) */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. diff --git a/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys.h index 9c897e5fd78..aca16654b70 100644 --- a/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys.h @@ -135,6 +135,19 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; +typedef enum +{ + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +}mxc_sys_package_type_t; + +typedef struct +{ + uint8_t day, month, year; +}mxc_sys_date_t; + #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -250,6 +263,24 @@ static inline int MXC_SYS_In_Crit_Section(void) */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. diff --git a/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys.h index 7b4dd76f618..d4a34348d6c 100644 --- a/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys.h @@ -167,6 +167,19 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; +typedef enum +{ + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +}mxc_sys_package_type_t; + +typedef struct +{ + uint8_t day, month, year; +}mxc_sys_date_t; + #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -282,6 +295,24 @@ static inline int MXC_SYS_In_Crit_Section(void) */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + /** * @brief Gets design revision of the chip. * diff --git a/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys.h index db5eb7380f3..93e8072a3c0 100644 --- a/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys.h @@ -159,6 +159,19 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; +typedef enum +{ + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +}mxc_sys_package_type_t; + +typedef struct +{ + uint8_t day, month, year; +}mxc_sys_date_t; + #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -273,7 +286,23 @@ static inline int MXC_SYS_In_Crit_Section(void) * @returns E_NO_ERROR if everything is successful. */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); - +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. diff --git a/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys.h index 93c407dcea3..2497b619fc3 100644 --- a/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys.h @@ -185,6 +185,19 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; +typedef enum +{ + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +}mxc_sys_package_type_t; + +typedef struct +{ + uint8_t day, month, year; +}mxc_sys_date_t; + #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -299,7 +312,40 @@ static inline int MXC_SYS_In_Crit_Section(void) * @returns E_NO_ERROR if everything is successful. */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); - +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. diff --git a/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys.h index c239d0858a4..97a790d2c8b 100644 --- a/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys.h @@ -215,6 +215,20 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; +typedef enum +{ + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +}mxc_sys_package_type_t; + +typedef struct +{ + uint8_t day, month, year; +}mxc_sys_date_t; + + #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -329,7 +343,23 @@ static inline int MXC_SYS_In_Crit_Section(void) * @returns E_NO_ERROR if everything is successful. */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); - +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. diff --git a/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys.h index e0055a05819..001c33449f1 100644 --- a/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys.h @@ -185,6 +185,19 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; +typedef enum +{ + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +}mxc_sys_package_type_t; + +typedef struct +{ + uint8_t day, month, year; +}mxc_sys_date_t; + #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -299,7 +312,23 @@ static inline int MXC_SYS_In_Crit_Section(void) * @returns E_NO_ERROR if everything is successful. */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); - +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. diff --git a/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys.h index 0f2ca395f33..a1dcb6e60c5 100644 --- a/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys.h @@ -198,6 +198,19 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; +typedef enum +{ + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +}mxc_sys_package_type_t; + +typedef struct +{ + uint8_t day, month, year; +}mxc_sys_date_t; + #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -312,7 +325,23 @@ static inline int MXC_SYS_In_Crit_Section(void) * @returns E_NO_ERROR if everything is successful. */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); - +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. From 4266b049f53496b8ed4670ce37873e61ee0d0b7e Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Fri, 25 Oct 2024 10:17:48 -0500 Subject: [PATCH 04/28] updated get test date to unlock lock info block --- .../PeriphDrivers/Source/SYS/sys_common.c | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Libraries/PeriphDrivers/Source/SYS/sys_common.c b/Libraries/PeriphDrivers/Source/SYS/sys_common.c index 85c14591255..bce1d8ff167 100644 --- a/Libraries/PeriphDrivers/Source/SYS/sys_common.c +++ b/Libraries/PeriphDrivers/Source/SYS/sys_common.c @@ -34,7 +34,7 @@ #include "gcr_regs.h" #include "fcr_regs.h" #include "mcr_regs.h" - +#include /** * @ingroup mxc_sys @@ -51,7 +51,7 @@ /* **** Globals **** */ static mxc_sys_package_type_t pkg_type = MXC_SYS_PKG_UNSET; - +bool info_block_unlocked = false; /* **** Functions **** */ /* ************************************************************************** */ @@ -63,29 +63,24 @@ mxc_sys_package_type_t MXC_SYS_GetPackageType(void) } mxc_sys_date_t date; - mxc_sys_date_t date_info; - - MXC_FLC_UnlockInfoBlock(MXC_INFO_MEM_BASE); - - MXC_SYS_GetTestDate(&date_info); // Package codes were only introduced when test date was int err = MXC_SYS_GetTestDate(&date); - if(err != E_NO_ERROR) { - pkg_type = MXC_SYS_PKG_UNSET; + return MXC_SYS_PKG_UNSET; } - else - { - const uint8_t maybe_pkg_type = REG8_VAL(PKG_CODE_OFFSET); - int err = MXC_SYS_SetPackageType(maybe_pkg_type); - MXC_ASSERT(err == E_NO_ERROR); - } - + MXC_FLC_UnlockInfoBlock(MXC_INFO_MEM_BASE); + + const uint8_t maybe_pkg_type = REG8_VAL(PKG_CODE_OFFSET); + int err = MXC_SYS_SetPackageType(maybe_pkg_type); + MXC_FLC_LockInfoBlock(MXC_INFO_MEM_BASE); + + MXC_ASSERT(err == E_NO_ERROR); + return pkg_type; } @@ -108,10 +103,15 @@ int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type) int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info) { MXC_ASSERT(date_info); - + + + MXC_FLC_UnlockInfoBlock(MXC_INFO_MEM_BASE); + date_info->day = REG8_VAL(DAY_CODE_OFFSET); date_info->month = REG8_VAL(MONTH_CODE_OFFSET); date_info->year = REG8_VAL(YEAR_CODE_OFFSET); + + MXC_FLC_LockInfoBlock(MXC_INFO_MEM_BASE); // Flash is cleared if not valid // Year 2255 is valid From 183116d00f05ffce9ce261a7fe0d16d3719edac7 Mon Sep 17 00:00:00 2001 From: EricB-ADI Date: Fri, 25 Oct 2024 15:25:56 +0000 Subject: [PATCH 05/28] clang-format bot reformatting. --- .../PeriphDrivers/Include/MAX32520/mxc_sys.h | 10 ++-- .../PeriphDrivers/Include/MAX32570/mxc_sys.h | 10 ++-- .../PeriphDrivers/Include/MAX32650/mxc_sys.h | 10 ++-- .../PeriphDrivers/Include/MAX32655/mxc_sys.h | 11 ++--- .../PeriphDrivers/Include/MAX32657/mxc_sys.h | 10 ++-- .../PeriphDrivers/Include/MAX32660/mxc_sys.h | 10 ++-- .../PeriphDrivers/Include/MAX32662/mxc_sys.h | 10 ++-- .../PeriphDrivers/Include/MAX32665/mxc_sys.h | 10 ++-- .../PeriphDrivers/Include/MAX32670/mxc_sys.h | 10 ++-- .../PeriphDrivers/Include/MAX32672/mxc_sys.h | 10 ++-- .../PeriphDrivers/Include/MAX32675/mxc_sys.h | 10 ++-- .../PeriphDrivers/Include/MAX32680/mxc_sys.h | 10 ++-- .../PeriphDrivers/Include/MAX32690/mxc_sys.h | 11 ++--- .../PeriphDrivers/Include/MAX78000/mxc_sys.h | 10 ++-- .../PeriphDrivers/Include/MAX78002/mxc_sys.h | 10 ++-- .../PeriphDrivers/Source/SYS/sys_common.c | 46 ++++++++----------- 16 files changed, 78 insertions(+), 120 deletions(-) diff --git a/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys.h index 1358ed49eef..5ca68732939 100644 --- a/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys.h @@ -120,18 +120,16 @@ typedef enum { MXC_SYS_CLOCK_DIV_64 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV64, MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum -{ +typedef enum { MXC_SYS_PKG_TQFN = 1, MXC_SYS_PKG_BGA = 2, MXC_SYS_PKG_WLP = 3, MXC_SYS_PKG_UNSET = 0xff -}mxc_sys_package_type_t; +} mxc_sys_package_type_t; -typedef struct -{ +typedef struct { uint8_t day, month, year; -}mxc_sys_date_t; +} mxc_sys_date_t; #define MXC_SYS_SCACHE_CLK 1 // Enable SCACHE CLK #define MXC_SYS_CTB_CLK 1 // Enable CTB CLK diff --git a/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys.h index fbdb4e231c1..3aee72308fd 100644 --- a/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys.h @@ -234,18 +234,16 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum -{ +typedef enum { MXC_SYS_PKG_TQFN = 1, MXC_SYS_PKG_BGA = 2, MXC_SYS_PKG_WLP = 3, MXC_SYS_PKG_UNSET = 0xff -}mxc_sys_package_type_t; +} mxc_sys_package_type_t; -typedef struct -{ +typedef struct { uint8_t day, month, year; -}mxc_sys_date_t; +} mxc_sys_date_t; #define MXC_SYS_SCACHE_CLK 1 // Enable SCACHE CLK #define MXC_SYS_CTB_CLK 1 // Enable CTB CLK diff --git a/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys.h index 65b17c9a150..1427ce52e02 100644 --- a/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys.h @@ -205,18 +205,16 @@ typedef enum { MXC_SYS_SYSTEM_DIV_128 = MXC_S_GCR_CLK_CTRL_SYSCLK_PRESCALE_DIV128, } mxc_sys_system_div_t; -typedef enum -{ +typedef enum { MXC_SYS_PKG_TQFN = 1, MXC_SYS_PKG_BGA = 2, MXC_SYS_PKG_WLP = 3, MXC_SYS_PKG_UNSET = 0xff -}mxc_sys_package_type_t; +} mxc_sys_package_type_t; -typedef struct -{ +typedef struct { uint8_t day, month, year; -}mxc_sys_date_t; +} mxc_sys_date_t; typedef struct { uint8_t scache_flag; diff --git a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h index 9993b908c74..6970a962478 100644 --- a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h @@ -185,19 +185,16 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum -{ +typedef enum { MXC_SYS_PKG_TQFN = 1, MXC_SYS_PKG_BGA = 2, MXC_SYS_PKG_WLP = 3, MXC_SYS_PKG_UNSET = 0xff -}mxc_sys_package_type_t; +} mxc_sys_package_type_t; -typedef struct -{ +typedef struct { uint8_t day, month, year; -}mxc_sys_date_t; - +} mxc_sys_date_t; #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN diff --git a/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys.h index eccd5fa638e..758716411ff 100644 --- a/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys.h @@ -116,18 +116,16 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum -{ +typedef enum { MXC_SYS_PKG_TQFN = 1, MXC_SYS_PKG_BGA = 2, MXC_SYS_PKG_WLP = 3, MXC_SYS_PKG_UNSET = 0xff -}mxc_sys_package_type_t; +} mxc_sys_package_type_t; -typedef struct -{ +typedef struct { uint8_t day, month, year; -}mxc_sys_date_t; +} mxc_sys_date_t; #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN diff --git a/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys.h index 857f7c114b3..7bfa472bbb7 100644 --- a/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys.h @@ -111,18 +111,16 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLK_CTRL_PSC_DIV128 } mxc_sys_system_clock_div_t; -typedef enum -{ +typedef enum { MXC_SYS_PKG_TQFN = 1, MXC_SYS_PKG_BGA = 2, MXC_SYS_PKG_WLP = 3, MXC_SYS_PKG_UNSET = 0xff -}mxc_sys_package_type_t; +} mxc_sys_package_type_t; -typedef struct -{ +typedef struct { uint8_t day, month, year; -}mxc_sys_date_t; +} mxc_sys_date_t; #define MXC_SYS_USN_LEN 8 diff --git a/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys.h index cf483622a95..25497829411 100644 --- a/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys.h @@ -141,18 +141,16 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum -{ +typedef enum { MXC_SYS_PKG_TQFN = 1, MXC_SYS_PKG_BGA = 2, MXC_SYS_PKG_WLP = 3, MXC_SYS_PKG_UNSET = 0xff -}mxc_sys_package_type_t; +} mxc_sys_package_type_t; -typedef struct -{ +typedef struct { uint8_t day, month, year; -}mxc_sys_date_t; +} mxc_sys_date_t; #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN diff --git a/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys.h index 736b5f460f5..459c5d2b489 100644 --- a/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys.h @@ -196,18 +196,16 @@ typedef enum { MXC_SYS_CLOCK_XTAL32K = MXC_V_GCR_CLKCN_CLKSEL_XTAL32K, } mxc_sys_system_clock_t; -typedef enum -{ +typedef enum { MXC_SYS_PKG_TQFN = 1, MXC_SYS_PKG_BGA = 2, MXC_SYS_PKG_WLP = 3, MXC_SYS_PKG_UNSET = 0xff -}mxc_sys_package_type_t; +} mxc_sys_package_type_t; -typedef struct -{ +typedef struct { uint8_t day, month, year; -}mxc_sys_date_t; +} mxc_sys_date_t; #define MXC_SYS_SCACHE_CLK 1 // Enable SCACHE CLK #define MXC_SYS_CTB_CLK 1 // Enable CTB CLK diff --git a/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys.h index aca16654b70..290a0679fae 100644 --- a/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys.h @@ -135,18 +135,16 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum -{ +typedef enum { MXC_SYS_PKG_TQFN = 1, MXC_SYS_PKG_BGA = 2, MXC_SYS_PKG_WLP = 3, MXC_SYS_PKG_UNSET = 0xff -}mxc_sys_package_type_t; +} mxc_sys_package_type_t; -typedef struct -{ +typedef struct { uint8_t day, month, year; -}mxc_sys_date_t; +} mxc_sys_date_t; #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN diff --git a/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys.h index d4a34348d6c..ab0a1cd348e 100644 --- a/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys.h @@ -167,18 +167,16 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum -{ +typedef enum { MXC_SYS_PKG_TQFN = 1, MXC_SYS_PKG_BGA = 2, MXC_SYS_PKG_WLP = 3, MXC_SYS_PKG_UNSET = 0xff -}mxc_sys_package_type_t; +} mxc_sys_package_type_t; -typedef struct -{ +typedef struct { uint8_t day, month, year; -}mxc_sys_date_t; +} mxc_sys_date_t; #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN diff --git a/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys.h index 93e8072a3c0..6a8bde80426 100644 --- a/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys.h @@ -159,18 +159,16 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum -{ +typedef enum { MXC_SYS_PKG_TQFN = 1, MXC_SYS_PKG_BGA = 2, MXC_SYS_PKG_WLP = 3, MXC_SYS_PKG_UNSET = 0xff -}mxc_sys_package_type_t; +} mxc_sys_package_type_t; -typedef struct -{ +typedef struct { uint8_t day, month, year; -}mxc_sys_date_t; +} mxc_sys_date_t; #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN diff --git a/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys.h index 2497b619fc3..3e79a29302b 100644 --- a/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys.h @@ -185,18 +185,16 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum -{ +typedef enum { MXC_SYS_PKG_TQFN = 1, MXC_SYS_PKG_BGA = 2, MXC_SYS_PKG_WLP = 3, MXC_SYS_PKG_UNSET = 0xff -}mxc_sys_package_type_t; +} mxc_sys_package_type_t; -typedef struct -{ +typedef struct { uint8_t day, month, year; -}mxc_sys_date_t; +} mxc_sys_date_t; #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN diff --git a/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys.h index 97a790d2c8b..03801d1f799 100644 --- a/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys.h @@ -215,19 +215,16 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum -{ +typedef enum { MXC_SYS_PKG_TQFN = 1, MXC_SYS_PKG_BGA = 2, MXC_SYS_PKG_WLP = 3, MXC_SYS_PKG_UNSET = 0xff -}mxc_sys_package_type_t; +} mxc_sys_package_type_t; -typedef struct -{ +typedef struct { uint8_t day, month, year; -}mxc_sys_date_t; - +} mxc_sys_date_t; #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN diff --git a/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys.h index 001c33449f1..0fd753127d8 100644 --- a/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys.h @@ -185,18 +185,16 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum -{ +typedef enum { MXC_SYS_PKG_TQFN = 1, MXC_SYS_PKG_BGA = 2, MXC_SYS_PKG_WLP = 3, MXC_SYS_PKG_UNSET = 0xff -}mxc_sys_package_type_t; +} mxc_sys_package_type_t; -typedef struct -{ +typedef struct { uint8_t day, month, year; -}mxc_sys_date_t; +} mxc_sys_date_t; #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN diff --git a/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys.h index a1dcb6e60c5..c9734fd5570 100644 --- a/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys.h @@ -198,18 +198,16 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum -{ +typedef enum { MXC_SYS_PKG_TQFN = 1, MXC_SYS_PKG_BGA = 2, MXC_SYS_PKG_WLP = 3, MXC_SYS_PKG_UNSET = 0xff -}mxc_sys_package_type_t; +} mxc_sys_package_type_t; -typedef struct -{ +typedef struct { uint8_t day, month, year; -}mxc_sys_date_t; +} mxc_sys_date_t; #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN diff --git a/Libraries/PeriphDrivers/Source/SYS/sys_common.c b/Libraries/PeriphDrivers/Source/SYS/sys_common.c index bce1d8ff167..3736d968de3 100644 --- a/Libraries/PeriphDrivers/Source/SYS/sys_common.c +++ b/Libraries/PeriphDrivers/Source/SYS/sys_common.c @@ -51,14 +51,13 @@ /* **** Globals **** */ static mxc_sys_package_type_t pkg_type = MXC_SYS_PKG_UNSET; -bool info_block_unlocked = false; +bool info_block_unlocked = false; /* **** Functions **** */ /* ************************************************************************** */ mxc_sys_package_type_t MXC_SYS_GetPackageType(void) { - if(pkg_type != MXC_SYS_PKG_UNSET) - { + if (pkg_type != MXC_SYS_PKG_UNSET) { return pkg_type; } @@ -66,63 +65,54 @@ mxc_sys_package_type_t MXC_SYS_GetPackageType(void) // Package codes were only introduced when test date was int err = MXC_SYS_GetTestDate(&date); - if(err != E_NO_ERROR) - { + if (err != E_NO_ERROR) { return MXC_SYS_PKG_UNSET; } - MXC_FLC_UnlockInfoBlock(MXC_INFO_MEM_BASE); const uint8_t maybe_pkg_type = REG8_VAL(PKG_CODE_OFFSET); int err = MXC_SYS_SetPackageType(maybe_pkg_type); - + MXC_FLC_LockInfoBlock(MXC_INFO_MEM_BASE); - - MXC_ASSERT(err == E_NO_ERROR); + MXC_ASSERT(err == E_NO_ERROR); return pkg_type; } int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type) { - switch(new_pkg_type) - { - case MXC_SYS_PKG_TQFN: - case MXC_SYS_PKG_BGA: - case MXC_SYS_PKG_WLP: - case MXC_SYS_PKG_UNSET: - pkg_type = new_pkg_type; - return E_NO_ERROR; - default: - return E_BAD_PARAM; + switch (new_pkg_type) { + case MXC_SYS_PKG_TQFN: + case MXC_SYS_PKG_BGA: + case MXC_SYS_PKG_WLP: + case MXC_SYS_PKG_UNSET: + pkg_type = new_pkg_type; + return E_NO_ERROR; + default: + return E_BAD_PARAM; } } - int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info) -{ +{ MXC_ASSERT(date_info); - MXC_FLC_UnlockInfoBlock(MXC_INFO_MEM_BASE); date_info->day = REG8_VAL(DAY_CODE_OFFSET); date_info->month = REG8_VAL(MONTH_CODE_OFFSET); date_info->year = REG8_VAL(YEAR_CODE_OFFSET); - + MXC_FLC_LockInfoBlock(MXC_INFO_MEM_BASE); // Flash is cleared if not valid // Year 2255 is valid - if(date_info->month > 12 || date_info->day > 31) - { + if (date_info->month > 12 || date_info->day > 31) { return E_INVALID; } - - - return E_NO_ERROR; + return E_NO_ERROR; } /**@} end of mxc_sys */ From 29453451af34e11cb83979e92d4465a0d2e805ff Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Fri, 25 Oct 2024 10:36:09 -0500 Subject: [PATCH 06/28] fixed redef error --- .../PeriphDrivers/Source/SYS/mxc_sys_common.h | 82 +++++++++++++++++++ .../PeriphDrivers/Source/SYS/sys_common.c | 10 ++- 2 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h diff --git a/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h b/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h new file mode 100644 index 00000000000..65217bab11a --- /dev/null +++ b/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h @@ -0,0 +1,82 @@ +/** + * @file mxc_sys.h + * @brief System level header file. + */ + +/****************************************************************************** + * + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Analog Devices, Inc.), + * Copyright (C) 2023-2024 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. + * + ******************************************************************************/ + +#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ +#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ + +#include "mxc_device.h" +#include "gcr_regs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup mxc_sys_common System Configuration (MXC_SYS) + * @ingroup syscfg + * @details API for system configuration common to all parts including getting package type. + * @{ + */ + + +/** @brief Enumeration to select Package Type*/ +typedef enum +{ + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +}mxc_sys_package_type_t; + +typedef struct +{ + uint8_t day, month, year; +}mxc_sys_date_t; + + +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + + +#ifdef __cplusplus +} +#endif + +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ diff --git a/Libraries/PeriphDrivers/Source/SYS/sys_common.c b/Libraries/PeriphDrivers/Source/SYS/sys_common.c index 3736d968de3..f507465e0ed 100644 --- a/Libraries/PeriphDrivers/Source/SYS/sys_common.c +++ b/Libraries/PeriphDrivers/Source/SYS/sys_common.c @@ -64,15 +64,19 @@ mxc_sys_package_type_t MXC_SYS_GetPackageType(void) mxc_sys_date_t date; // Package codes were only introduced when test date was - int err = MXC_SYS_GetTestDate(&date); - if (err != E_NO_ERROR) { + if(MXC_SYS_GetTestDate(&date) != E_NO_ERROR) + { return MXC_SYS_PKG_UNSET; } MXC_FLC_UnlockInfoBlock(MXC_INFO_MEM_BASE); const uint8_t maybe_pkg_type = REG8_VAL(PKG_CODE_OFFSET); - int err = MXC_SYS_SetPackageType(maybe_pkg_type); + const int err = MXC_SYS_SetPackageType(maybe_pkg_type); + + MXC_FLC_LockInfoBlock(MXC_INFO_MEM_BASE); + + MXC_ASSERT(err == E_NO_ERROR); MXC_FLC_LockInfoBlock(MXC_INFO_MEM_BASE); From d20c505c0d56c4ee63a3cdb5ec6bb51ccb386a8b Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Fri, 25 Oct 2024 10:37:46 -0500 Subject: [PATCH 07/28] fixed copy from rebase --- Libraries/PeriphDrivers/Source/SYS/sys_common.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Libraries/PeriphDrivers/Source/SYS/sys_common.c b/Libraries/PeriphDrivers/Source/SYS/sys_common.c index f507465e0ed..07087f83f9a 100644 --- a/Libraries/PeriphDrivers/Source/SYS/sys_common.c +++ b/Libraries/PeriphDrivers/Source/SYS/sys_common.c @@ -77,11 +77,7 @@ mxc_sys_package_type_t MXC_SYS_GetPackageType(void) MXC_FLC_LockInfoBlock(MXC_INFO_MEM_BASE); MXC_ASSERT(err == E_NO_ERROR); - - MXC_FLC_LockInfoBlock(MXC_INFO_MEM_BASE); - - MXC_ASSERT(err == E_NO_ERROR); - + return pkg_type; } int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type) From e0da3630728e86b9c9a20fadcd304dd850905575 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Fri, 25 Oct 2024 10:40:40 -0500 Subject: [PATCH 08/28] format --- Libraries/PeriphDrivers/Source/SYS/sys_common.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Libraries/PeriphDrivers/Source/SYS/sys_common.c b/Libraries/PeriphDrivers/Source/SYS/sys_common.c index 07087f83f9a..4549a8ef331 100644 --- a/Libraries/PeriphDrivers/Source/SYS/sys_common.c +++ b/Libraries/PeriphDrivers/Source/SYS/sys_common.c @@ -64,8 +64,7 @@ mxc_sys_package_type_t MXC_SYS_GetPackageType(void) mxc_sys_date_t date; // Package codes were only introduced when test date was - if(MXC_SYS_GetTestDate(&date) != E_NO_ERROR) - { + if (MXC_SYS_GetTestDate(&date) != E_NO_ERROR) { return MXC_SYS_PKG_UNSET; } @@ -73,11 +72,11 @@ mxc_sys_package_type_t MXC_SYS_GetPackageType(void) const uint8_t maybe_pkg_type = REG8_VAL(PKG_CODE_OFFSET); const int err = MXC_SYS_SetPackageType(maybe_pkg_type); - + MXC_FLC_LockInfoBlock(MXC_INFO_MEM_BASE); - + MXC_ASSERT(err == E_NO_ERROR); - + return pkg_type; } int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type) From a773217addbe041508403c2e8640c13198f4bbc0 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Fri, 25 Oct 2024 10:42:22 -0500 Subject: [PATCH 09/28] format h --- Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h b/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h index 65217bab11a..fd23f1d6221 100644 --- a/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h @@ -40,21 +40,17 @@ extern "C" { * @{ */ - /** @brief Enumeration to select Package Type*/ -typedef enum -{ +typedef enum { MXC_SYS_PKG_TQFN = 1, MXC_SYS_PKG_BGA = 2, MXC_SYS_PKG_WLP = 3, MXC_SYS_PKG_UNSET = 0xff -}mxc_sys_package_type_t; +} mxc_sys_package_type_t; -typedef struct -{ +typedef struct { uint8_t day, month, year; -}mxc_sys_date_t; - +} mxc_sys_date_t; /** * @brief Reads the device package type. @@ -74,7 +70,6 @@ int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); */ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - #ifdef __cplusplus } #endif From 1665ad723bf7ae38f02e95972dfb045ea2b8357c Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Fri, 25 Oct 2024 10:47:36 -0500 Subject: [PATCH 10/28] add sys common to all mxc_sys.h --- .../PeriphDrivers/Include/MAX32520/mxc_sys.h | 29 +----------- .../PeriphDrivers/Include/MAX32570/mxc_sys.h | 31 +----------- .../PeriphDrivers/Include/MAX32650/mxc_sys.h | 30 +----------- .../PeriphDrivers/Include/MAX32655/mxc_sys.h | 14 ------ .../PeriphDrivers/Include/MAX32657/mxc_sys.h | 30 +----------- .../PeriphDrivers/Include/MAX32660/mxc_sys.h | 30 +----------- .../PeriphDrivers/Include/MAX32662/mxc_sys.h | 30 +----------- .../PeriphDrivers/Include/MAX32665/mxc_sys.h | 30 +----------- .../PeriphDrivers/Include/MAX32670/mxc_sys.h | 30 +----------- .../PeriphDrivers/Include/MAX32672/mxc_sys.h | 30 +----------- .../PeriphDrivers/Include/MAX32675/mxc_sys.h | 30 +----------- .../PeriphDrivers/Include/MAX32680/mxc_sys.h | 47 +------------------ .../PeriphDrivers/Include/MAX32690/mxc_sys.h | 30 +----------- .../PeriphDrivers/Include/MAX78000/mxc_sys.h | 30 +----------- .../PeriphDrivers/Include/MAX78002/mxc_sys.h | 30 +----------- 15 files changed, 20 insertions(+), 431 deletions(-) diff --git a/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys.h index 5ca68732939..1f78fe28c13 100644 --- a/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys.h @@ -28,6 +28,7 @@ #include "mxc_device.h" #include "gcr_regs.h" +#include "mxc_sys_common.h" #ifdef __cplusplus extern "C" { @@ -120,16 +121,6 @@ typedef enum { MXC_SYS_CLOCK_DIV_64 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV64, MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; #define MXC_SYS_SCACHE_CLK 1 // Enable SCACHE CLK #define MXC_SYS_CTB_CLK 1 // Enable CTB CLK @@ -328,24 +319,6 @@ uint8_t MXC_SYS_GetRev(void); */ int MXC_SYS_GetUSN(uint8_t *serialNumber, int len); -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - /** * @brief This function PERMANENTLY locks the Debug Access Port. * diff --git a/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys.h index 3aee72308fd..367e7b4ed39 100644 --- a/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys.h @@ -28,6 +28,8 @@ #include "mxc_device.h" #include "gcr_regs.h" +#include "mxc_sys_common.h" + #ifdef __cplusplus extern "C" { @@ -234,17 +236,6 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - #define MXC_SYS_SCACHE_CLK 1 // Enable SCACHE CLK #define MXC_SYS_CTB_CLK 1 // Enable CTB CLK @@ -442,24 +433,6 @@ uint8_t MXC_SYS_GetRev(void); */ int MXC_SYS_GetUSN(uint8_t *serialNumber, int len); -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - /** * @brief This function PERMANENTLY locks the Debug Access Port. * diff --git a/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys.h index 1427ce52e02..7a9019676b2 100644 --- a/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys.h @@ -42,6 +42,7 @@ #include "spi_regs.h" #include "wdt_regs.h" #include "dma.h" +#include "mxc_sys_common.h" #ifdef __cplusplus extern "C" { @@ -205,17 +206,6 @@ typedef enum { MXC_SYS_SYSTEM_DIV_128 = MXC_S_GCR_CLK_CTRL_SYSCLK_PRESCALE_DIV128, } mxc_sys_system_div_t; -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - typedef struct { uint8_t scache_flag; uint8_t crypto_flag; @@ -432,24 +422,6 @@ uint8_t MXC_SYS_GetRev(void); */ int MXC_SYS_GetUSN(uint8_t *serialNumber, int len); -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - /** * @brief System level initialization for SCHACE module. * @param sys_cfg System configuration object diff --git a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h index 6970a962478..a48dc8de61c 100644 --- a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h @@ -310,22 +310,8 @@ static inline int MXC_SYS_In_Crit_Section(void) * @returns E_NO_ERROR if everything is successful. */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); /** * @brief Gets design revision of the chip. diff --git a/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys.h index 758716411ff..6bd24777f43 100644 --- a/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys.h @@ -26,6 +26,7 @@ #include "mxc_device.h" #include "gcr_regs.h" +#include "mxc_sys_common.h" #ifdef __cplusplus extern "C" { @@ -116,17 +117,6 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -242,24 +232,6 @@ static inline int MXC_SYS_In_Crit_Section(void) */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. diff --git a/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys.h index 7bfa472bbb7..7441f78616e 100644 --- a/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys.h @@ -28,6 +28,7 @@ #include "mxc_device.h" #include "gcr_regs.h" +#include "mxc_sys_common.h" #ifdef __cplusplus extern "C" { @@ -111,17 +112,6 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLK_CTRL_PSC_DIV128 } mxc_sys_system_clock_div_t; -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - #define MXC_SYS_USN_LEN 8 /***** Function Prototypes *****/ @@ -236,24 +226,6 @@ static inline int MXC_SYS_In_Crit_Section(void) */ int MXC_SYS_GetUSN(uint8_t *usn, int len, int part); -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. diff --git a/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys.h index 25497829411..6f3c5eb3961 100644 --- a/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys.h @@ -29,6 +29,7 @@ #include "mxc_device.h" #include "gcr_regs.h" #include "mcr_regs.h" +#include "mxc_sys_common.h" #ifdef __cplusplus extern "C" { @@ -141,17 +142,6 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -267,24 +257,6 @@ static inline int MXC_SYS_In_Crit_Section(void) */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. diff --git a/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys.h index 459c5d2b489..c293087a1dc 100644 --- a/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys.h @@ -28,6 +28,7 @@ #include "mxc_device.h" #include "gcr_regs.h" +#include "mxc_sys_common.h" #ifdef __cplusplus extern "C" { @@ -196,17 +197,6 @@ typedef enum { MXC_SYS_CLOCK_XTAL32K = MXC_V_GCR_CLKCN_CLKSEL_XTAL32K, } mxc_sys_system_clock_t; -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - #define MXC_SYS_SCACHE_CLK 1 // Enable SCACHE CLK #define MXC_SYS_CTB_CLK 1 // Enable CTB CLK @@ -325,24 +315,6 @@ static inline int MXC_SYS_In_Crit_Section(void) */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. diff --git a/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys.h index 290a0679fae..18bfc2e308b 100644 --- a/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys.h @@ -29,6 +29,7 @@ #include "mxc_device.h" #include "gcr_regs.h" #include "mcr_regs.h" +#include "mxc_sys_common.h" #ifdef __cplusplus extern "C" { @@ -135,17 +136,6 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -261,24 +251,6 @@ static inline int MXC_SYS_In_Crit_Section(void) */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. diff --git a/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys.h index ab0a1cd348e..3975ba28a9b 100644 --- a/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys.h @@ -29,6 +29,7 @@ #include "mxc_device.h" #include "gcr_regs.h" #include "mcr_regs.h" +#include "mxc_sys_common.h" #ifdef __cplusplus extern "C" { @@ -167,17 +168,6 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -293,24 +283,6 @@ static inline int MXC_SYS_In_Crit_Section(void) */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - /** * @brief Gets design revision of the chip. * diff --git a/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys.h index 6a8bde80426..bbe6a295ee7 100644 --- a/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys.h @@ -29,6 +29,7 @@ #include "mxc_device.h" #include "gcr_regs.h" #include "mcr_regs.h" +#include "mxc_sys_common.h" #ifdef __cplusplus extern "C" { @@ -159,17 +160,6 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -284,23 +274,7 @@ static inline int MXC_SYS_In_Crit_Section(void) * @returns E_NO_ERROR if everything is successful. */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. diff --git a/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys.h index 3e79a29302b..734a1ed617b 100644 --- a/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys.h @@ -29,6 +29,7 @@ #include "mxc_device.h" #include "gcr_regs.h" #include "lpgcr_regs.h" +#include "mxc_sys_common.h" #ifdef __cplusplus extern "C" { @@ -185,17 +186,6 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -310,40 +300,7 @@ static inline int MXC_SYS_In_Crit_Section(void) * @returns E_NO_ERROR if everything is successful. */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. diff --git a/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys.h index 03801d1f799..8a6105be66e 100644 --- a/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys.h @@ -30,6 +30,7 @@ #include "mxc_device.h" #include "lpgcr_regs.h" #include "gcr_regs.h" +#include "mxc_sys_common.h" #ifdef __cplusplus extern "C" { @@ -215,17 +216,6 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -340,23 +330,7 @@ static inline int MXC_SYS_In_Crit_Section(void) * @returns E_NO_ERROR if everything is successful. */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. diff --git a/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys.h index 0fd753127d8..c961c459f6d 100644 --- a/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys.h @@ -29,6 +29,7 @@ #include "mxc_device.h" #include "lpgcr_regs.h" #include "gcr_regs.h" +#include "mxc_sys_common.h" #ifdef __cplusplus extern "C" { @@ -185,17 +186,6 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -310,23 +300,7 @@ static inline int MXC_SYS_In_Crit_Section(void) * @returns E_NO_ERROR if everything is successful. */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. diff --git a/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys.h index c9734fd5570..bef52edbf67 100644 --- a/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys.h @@ -30,6 +30,7 @@ #include "mxc_device.h" #include "lpgcr_regs.h" #include "gcr_regs.h" +#include "mxc_sys_common.h" #ifdef __cplusplus extern "C" { @@ -198,17 +199,6 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -323,23 +313,7 @@ static inline int MXC_SYS_In_Crit_Section(void) * @returns E_NO_ERROR if everything is successful. */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + /** * @brief Determines if the selected peripheral clock is enabled. * @param clock Enumeration for desired clock. From f8d3088847413a443d42fcca70152820e128a624 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Fri, 25 Oct 2024 10:49:09 -0500 Subject: [PATCH 11/28] remove redef from 655 mxc_sys.h --- .../PeriphDrivers/Include/MAX32655/mxc_sys.h | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h index a48dc8de61c..c6227c9fe7f 100644 --- a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h @@ -185,17 +185,6 @@ typedef enum { MXC_SYS_CLOCK_DIV_128 = MXC_S_GCR_CLKCTRL_SYSCLK_DIV_DIV128 } mxc_sys_system_clock_div_t; -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - #define MXC_SYS_USN_CHECKSUM_LEN 16 // Length of the USN + padding for checksum compute #define MXC_SYS_USN_CSUM_FIELD_LEN 2 // Size of the checksum field in the USN #define MXC_SYS_USN_LEN 13 // Size of the USN including the checksum @@ -310,9 +299,7 @@ static inline int MXC_SYS_In_Crit_Section(void) * @returns E_NO_ERROR if everything is successful. */ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum); -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + /** * @brief Gets design revision of the chip. * From 698bc6e3624bcb83b0ddfffb0dabb741d4ee6150 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Fri, 25 Oct 2024 11:00:17 -0500 Subject: [PATCH 12/28] added mxc_sys_common.h to periphdriver.mk --- Libraries/PeriphDrivers/periphdriver.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/PeriphDrivers/periphdriver.mk b/Libraries/PeriphDrivers/periphdriver.mk index 6e873ef2c89..96b7d393755 100644 --- a/Libraries/PeriphDrivers/periphdriver.mk +++ b/Libraries/PeriphDrivers/periphdriver.mk @@ -85,6 +85,8 @@ export COMPILER include ${PERIPH_DRIVER_DIR}/$(TARGET_LC)_files.mk IPATH += ${PERIPH_DRIVER_INCLUDE_DIR} +IPATH += ${PERIPH_DRIVER_DIR}/SYS/Source + ifeq "$(PD_LIBRARY_VARIANT)" "" PERIPH_DRIVER_LIB_FILENAME := libPeriphDriver else @@ -105,4 +107,4 @@ clean.periph: @$(MAKE) -f ${PERIPH_DRIVER_DIR}/libPeriphDriver.mk BUILD_DIR=${PERIPH_DRIVER_BUILD_DIR} PERIPH_DRIVER_LIB_FILENAME=$(PERIPH_DRIVER_LIB_FILENAME) clean query.periphdrivers: - @$(MAKE) -f ${PERIPH_DRIVER_DIR}/libPeriphDriver.mk query QUERY_VAR="${QUERY_VAR}" \ No newline at end of file + @$(MAKE) -f ${PERIPH_DRIVER_DIR}/libPeriphDriver.mk query QUERY_VAR="${QUERY_VAR}" From b3d0cfb23a19c552b4680039c94b9b0d479159bd Mon Sep 17 00:00:00 2001 From: EricB-ADI Date: Fri, 25 Oct 2024 16:05:35 +0000 Subject: [PATCH 13/28] clang-format bot reformatting. --- Libraries/PeriphDrivers/Include/MAX32570/mxc_sys.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys.h index 367e7b4ed39..ec6071faf99 100644 --- a/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys.h @@ -30,7 +30,6 @@ #include "gcr_regs.h" #include "mxc_sys_common.h" - #ifdef __cplusplus extern "C" { #endif From 6f907460dcba042658f02b3ac6f359c092cceb9e Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Fri, 25 Oct 2024 13:33:14 -0500 Subject: [PATCH 14/28] added sys_common to me17 --- Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h index c6227c9fe7f..b11adeabb99 100644 --- a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h +++ b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys.h @@ -29,6 +29,7 @@ #include "mxc_device.h" #include "gcr_regs.h" #include "lpgcr_regs.h" +#include "mxc_sys_common.h" #ifdef __cplusplus extern "C" { From 092ae59f3f298de52b08723d260bc8b95e31402d Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Fri, 25 Oct 2024 13:36:30 -0500 Subject: [PATCH 15/28] add sys common to 655 --- Libraries/PeriphDrivers/periphdriver.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Libraries/PeriphDrivers/periphdriver.mk b/Libraries/PeriphDrivers/periphdriver.mk index 96b7d393755..3c31f96e3cf 100644 --- a/Libraries/PeriphDrivers/periphdriver.mk +++ b/Libraries/PeriphDrivers/periphdriver.mk @@ -84,8 +84,7 @@ export COMPILER # export MFLOAT_ABI include ${PERIPH_DRIVER_DIR}/$(TARGET_LC)_files.mk -IPATH += ${PERIPH_DRIVER_INCLUDE_DIR} -IPATH += ${PERIPH_DRIVER_DIR}/SYS/Source +IPATH += ${PERIPH_DRIVER_INCLUDE_DIR} ${PERIPH_DRIVER_DIR}/SYS/Source ifeq "$(PD_LIBRARY_VARIANT)" "" PERIPH_DRIVER_LIB_FILENAME := libPeriphDriver From 1f0f538844af3fc11238f0f34658c0bc6c50cb35 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Fri, 25 Oct 2024 14:35:29 -0500 Subject: [PATCH 16/28] copy sys common to part files --- .../Include/MAX32520/mxc_sys_common.h | 78 +++++++++++++++++++ .../Include/MAX32570/mxc_sys_common.h | 78 +++++++++++++++++++ .../Include/MAX32572/mxc_sys_common.h | 78 +++++++++++++++++++ .../Include/MAX32650/mxc_sys_common.h | 78 +++++++++++++++++++ .../Include/MAX32655/mxc_sys_common.h | 78 +++++++++++++++++++ .../Include/MAX32657/mxc_sys_common.h | 78 +++++++++++++++++++ .../Include/MAX32660/mxc_sys_common.h | 78 +++++++++++++++++++ .../Include/MAX32662/mxc_sys_common.h | 78 +++++++++++++++++++ .../Include/MAX32665/mxc_sys_common.h | 78 +++++++++++++++++++ .../Include/MAX32670/mxc_sys_common.h | 78 +++++++++++++++++++ .../Include/MAX32672/mxc_sys_common.h | 78 +++++++++++++++++++ .../Include/MAX32675/mxc_sys_common.h | 78 +++++++++++++++++++ .../Include/MAX32680/mxc_sys_common.h | 78 +++++++++++++++++++ .../Include/MAX32690/mxc_sys_common.h | 78 +++++++++++++++++++ .../Include/MAX78000/mxc_sys_common.h | 78 +++++++++++++++++++ .../Include/MAX78002/mxc_sys_common.h | 78 +++++++++++++++++++ 16 files changed, 1248 insertions(+) create mode 100644 Libraries/PeriphDrivers/Include/MAX32520/mxc_sys_common.h create mode 100644 Libraries/PeriphDrivers/Include/MAX32570/mxc_sys_common.h create mode 100644 Libraries/PeriphDrivers/Include/MAX32572/mxc_sys_common.h create mode 100644 Libraries/PeriphDrivers/Include/MAX32650/mxc_sys_common.h create mode 100644 Libraries/PeriphDrivers/Include/MAX32655/mxc_sys_common.h create mode 100644 Libraries/PeriphDrivers/Include/MAX32657/mxc_sys_common.h create mode 100644 Libraries/PeriphDrivers/Include/MAX32660/mxc_sys_common.h create mode 100644 Libraries/PeriphDrivers/Include/MAX32662/mxc_sys_common.h create mode 100644 Libraries/PeriphDrivers/Include/MAX32665/mxc_sys_common.h create mode 100644 Libraries/PeriphDrivers/Include/MAX32670/mxc_sys_common.h create mode 100644 Libraries/PeriphDrivers/Include/MAX32672/mxc_sys_common.h create mode 100644 Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h create mode 100644 Libraries/PeriphDrivers/Include/MAX32680/mxc_sys_common.h create mode 100644 Libraries/PeriphDrivers/Include/MAX32690/mxc_sys_common.h create mode 100644 Libraries/PeriphDrivers/Include/MAX78000/mxc_sys_common.h create mode 100644 Libraries/PeriphDrivers/Include/MAX78002/mxc_sys_common.h diff --git a/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys_common.h new file mode 100644 index 00000000000..10ce2324201 --- /dev/null +++ b/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys_common.h @@ -0,0 +1,78 @@ +/** + * @file mxc_sys.h + * @brief System level header file. + */ + +/****************************************************************************** + * + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Analog Devices, Inc.), + * Copyright (C) 2023-2024 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. + * + ******************************************************************************/ + +#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ +#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ + +#include "mxc_device.h" +#include "gcr_regs.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup mxc_sys_common System Configuration (MXC_SYS) + * @ingroup syscfg + * @details API for system configuration common to all parts including getting package type. + * @{ + */ + +/** @brief Enumeration to select Package Type*/ +typedef enum { + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +} mxc_sys_package_type_t; + +typedef struct { + uint8_t day, month, year; +} mxc_sys_date_t; + +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + +#ifdef __cplusplus +} +#endif + +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys_common.h new file mode 100644 index 00000000000..10ce2324201 --- /dev/null +++ b/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys_common.h @@ -0,0 +1,78 @@ +/** + * @file mxc_sys.h + * @brief System level header file. + */ + +/****************************************************************************** + * + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Analog Devices, Inc.), + * Copyright (C) 2023-2024 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. + * + ******************************************************************************/ + +#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ +#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ + +#include "mxc_device.h" +#include "gcr_regs.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup mxc_sys_common System Configuration (MXC_SYS) + * @ingroup syscfg + * @details API for system configuration common to all parts including getting package type. + * @{ + */ + +/** @brief Enumeration to select Package Type*/ +typedef enum { + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +} mxc_sys_package_type_t; + +typedef struct { + uint8_t day, month, year; +} mxc_sys_date_t; + +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + +#ifdef __cplusplus +} +#endif + +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32572/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32572/mxc_sys_common.h new file mode 100644 index 00000000000..10ce2324201 --- /dev/null +++ b/Libraries/PeriphDrivers/Include/MAX32572/mxc_sys_common.h @@ -0,0 +1,78 @@ +/** + * @file mxc_sys.h + * @brief System level header file. + */ + +/****************************************************************************** + * + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Analog Devices, Inc.), + * Copyright (C) 2023-2024 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. + * + ******************************************************************************/ + +#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ +#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ + +#include "mxc_device.h" +#include "gcr_regs.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup mxc_sys_common System Configuration (MXC_SYS) + * @ingroup syscfg + * @details API for system configuration common to all parts including getting package type. + * @{ + */ + +/** @brief Enumeration to select Package Type*/ +typedef enum { + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +} mxc_sys_package_type_t; + +typedef struct { + uint8_t day, month, year; +} mxc_sys_date_t; + +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + +#ifdef __cplusplus +} +#endif + +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys_common.h new file mode 100644 index 00000000000..10ce2324201 --- /dev/null +++ b/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys_common.h @@ -0,0 +1,78 @@ +/** + * @file mxc_sys.h + * @brief System level header file. + */ + +/****************************************************************************** + * + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Analog Devices, Inc.), + * Copyright (C) 2023-2024 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. + * + ******************************************************************************/ + +#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ +#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ + +#include "mxc_device.h" +#include "gcr_regs.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup mxc_sys_common System Configuration (MXC_SYS) + * @ingroup syscfg + * @details API for system configuration common to all parts including getting package type. + * @{ + */ + +/** @brief Enumeration to select Package Type*/ +typedef enum { + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +} mxc_sys_package_type_t; + +typedef struct { + uint8_t day, month, year; +} mxc_sys_date_t; + +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + +#ifdef __cplusplus +} +#endif + +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys_common.h new file mode 100644 index 00000000000..10ce2324201 --- /dev/null +++ b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys_common.h @@ -0,0 +1,78 @@ +/** + * @file mxc_sys.h + * @brief System level header file. + */ + +/****************************************************************************** + * + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Analog Devices, Inc.), + * Copyright (C) 2023-2024 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. + * + ******************************************************************************/ + +#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ +#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ + +#include "mxc_device.h" +#include "gcr_regs.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup mxc_sys_common System Configuration (MXC_SYS) + * @ingroup syscfg + * @details API for system configuration common to all parts including getting package type. + * @{ + */ + +/** @brief Enumeration to select Package Type*/ +typedef enum { + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +} mxc_sys_package_type_t; + +typedef struct { + uint8_t day, month, year; +} mxc_sys_date_t; + +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + +#ifdef __cplusplus +} +#endif + +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys_common.h new file mode 100644 index 00000000000..10ce2324201 --- /dev/null +++ b/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys_common.h @@ -0,0 +1,78 @@ +/** + * @file mxc_sys.h + * @brief System level header file. + */ + +/****************************************************************************** + * + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Analog Devices, Inc.), + * Copyright (C) 2023-2024 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. + * + ******************************************************************************/ + +#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ +#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ + +#include "mxc_device.h" +#include "gcr_regs.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup mxc_sys_common System Configuration (MXC_SYS) + * @ingroup syscfg + * @details API for system configuration common to all parts including getting package type. + * @{ + */ + +/** @brief Enumeration to select Package Type*/ +typedef enum { + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +} mxc_sys_package_type_t; + +typedef struct { + uint8_t day, month, year; +} mxc_sys_date_t; + +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + +#ifdef __cplusplus +} +#endif + +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys_common.h new file mode 100644 index 00000000000..10ce2324201 --- /dev/null +++ b/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys_common.h @@ -0,0 +1,78 @@ +/** + * @file mxc_sys.h + * @brief System level header file. + */ + +/****************************************************************************** + * + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Analog Devices, Inc.), + * Copyright (C) 2023-2024 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. + * + ******************************************************************************/ + +#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ +#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ + +#include "mxc_device.h" +#include "gcr_regs.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup mxc_sys_common System Configuration (MXC_SYS) + * @ingroup syscfg + * @details API for system configuration common to all parts including getting package type. + * @{ + */ + +/** @brief Enumeration to select Package Type*/ +typedef enum { + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +} mxc_sys_package_type_t; + +typedef struct { + uint8_t day, month, year; +} mxc_sys_date_t; + +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + +#ifdef __cplusplus +} +#endif + +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys_common.h new file mode 100644 index 00000000000..10ce2324201 --- /dev/null +++ b/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys_common.h @@ -0,0 +1,78 @@ +/** + * @file mxc_sys.h + * @brief System level header file. + */ + +/****************************************************************************** + * + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Analog Devices, Inc.), + * Copyright (C) 2023-2024 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. + * + ******************************************************************************/ + +#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ +#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ + +#include "mxc_device.h" +#include "gcr_regs.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup mxc_sys_common System Configuration (MXC_SYS) + * @ingroup syscfg + * @details API for system configuration common to all parts including getting package type. + * @{ + */ + +/** @brief Enumeration to select Package Type*/ +typedef enum { + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +} mxc_sys_package_type_t; + +typedef struct { + uint8_t day, month, year; +} mxc_sys_date_t; + +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + +#ifdef __cplusplus +} +#endif + +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys_common.h new file mode 100644 index 00000000000..10ce2324201 --- /dev/null +++ b/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys_common.h @@ -0,0 +1,78 @@ +/** + * @file mxc_sys.h + * @brief System level header file. + */ + +/****************************************************************************** + * + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Analog Devices, Inc.), + * Copyright (C) 2023-2024 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. + * + ******************************************************************************/ + +#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ +#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ + +#include "mxc_device.h" +#include "gcr_regs.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup mxc_sys_common System Configuration (MXC_SYS) + * @ingroup syscfg + * @details API for system configuration common to all parts including getting package type. + * @{ + */ + +/** @brief Enumeration to select Package Type*/ +typedef enum { + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +} mxc_sys_package_type_t; + +typedef struct { + uint8_t day, month, year; +} mxc_sys_date_t; + +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + +#ifdef __cplusplus +} +#endif + +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys_common.h new file mode 100644 index 00000000000..10ce2324201 --- /dev/null +++ b/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys_common.h @@ -0,0 +1,78 @@ +/** + * @file mxc_sys.h + * @brief System level header file. + */ + +/****************************************************************************** + * + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Analog Devices, Inc.), + * Copyright (C) 2023-2024 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. + * + ******************************************************************************/ + +#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ +#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ + +#include "mxc_device.h" +#include "gcr_regs.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup mxc_sys_common System Configuration (MXC_SYS) + * @ingroup syscfg + * @details API for system configuration common to all parts including getting package type. + * @{ + */ + +/** @brief Enumeration to select Package Type*/ +typedef enum { + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +} mxc_sys_package_type_t; + +typedef struct { + uint8_t day, month, year; +} mxc_sys_date_t; + +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + +#ifdef __cplusplus +} +#endif + +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys_common.h new file mode 100644 index 00000000000..10ce2324201 --- /dev/null +++ b/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys_common.h @@ -0,0 +1,78 @@ +/** + * @file mxc_sys.h + * @brief System level header file. + */ + +/****************************************************************************** + * + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Analog Devices, Inc.), + * Copyright (C) 2023-2024 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. + * + ******************************************************************************/ + +#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ +#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ + +#include "mxc_device.h" +#include "gcr_regs.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup mxc_sys_common System Configuration (MXC_SYS) + * @ingroup syscfg + * @details API for system configuration common to all parts including getting package type. + * @{ + */ + +/** @brief Enumeration to select Package Type*/ +typedef enum { + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +} mxc_sys_package_type_t; + +typedef struct { + uint8_t day, month, year; +} mxc_sys_date_t; + +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + +#ifdef __cplusplus +} +#endif + +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h new file mode 100644 index 00000000000..10ce2324201 --- /dev/null +++ b/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h @@ -0,0 +1,78 @@ +/** + * @file mxc_sys.h + * @brief System level header file. + */ + +/****************************************************************************** + * + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Analog Devices, Inc.), + * Copyright (C) 2023-2024 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. + * + ******************************************************************************/ + +#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ +#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ + +#include "mxc_device.h" +#include "gcr_regs.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup mxc_sys_common System Configuration (MXC_SYS) + * @ingroup syscfg + * @details API for system configuration common to all parts including getting package type. + * @{ + */ + +/** @brief Enumeration to select Package Type*/ +typedef enum { + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +} mxc_sys_package_type_t; + +typedef struct { + uint8_t day, month, year; +} mxc_sys_date_t; + +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + +#ifdef __cplusplus +} +#endif + +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys_common.h new file mode 100644 index 00000000000..10ce2324201 --- /dev/null +++ b/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys_common.h @@ -0,0 +1,78 @@ +/** + * @file mxc_sys.h + * @brief System level header file. + */ + +/****************************************************************************** + * + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Analog Devices, Inc.), + * Copyright (C) 2023-2024 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. + * + ******************************************************************************/ + +#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ +#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ + +#include "mxc_device.h" +#include "gcr_regs.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup mxc_sys_common System Configuration (MXC_SYS) + * @ingroup syscfg + * @details API for system configuration common to all parts including getting package type. + * @{ + */ + +/** @brief Enumeration to select Package Type*/ +typedef enum { + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +} mxc_sys_package_type_t; + +typedef struct { + uint8_t day, month, year; +} mxc_sys_date_t; + +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + +#ifdef __cplusplus +} +#endif + +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys_common.h new file mode 100644 index 00000000000..10ce2324201 --- /dev/null +++ b/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys_common.h @@ -0,0 +1,78 @@ +/** + * @file mxc_sys.h + * @brief System level header file. + */ + +/****************************************************************************** + * + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Analog Devices, Inc.), + * Copyright (C) 2023-2024 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. + * + ******************************************************************************/ + +#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ +#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ + +#include "mxc_device.h" +#include "gcr_regs.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup mxc_sys_common System Configuration (MXC_SYS) + * @ingroup syscfg + * @details API for system configuration common to all parts including getting package type. + * @{ + */ + +/** @brief Enumeration to select Package Type*/ +typedef enum { + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +} mxc_sys_package_type_t; + +typedef struct { + uint8_t day, month, year; +} mxc_sys_date_t; + +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + +#ifdef __cplusplus +} +#endif + +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys_common.h new file mode 100644 index 00000000000..10ce2324201 --- /dev/null +++ b/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys_common.h @@ -0,0 +1,78 @@ +/** + * @file mxc_sys.h + * @brief System level header file. + */ + +/****************************************************************************** + * + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Analog Devices, Inc.), + * Copyright (C) 2023-2024 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. + * + ******************************************************************************/ + +#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ +#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ + +#include "mxc_device.h" +#include "gcr_regs.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup mxc_sys_common System Configuration (MXC_SYS) + * @ingroup syscfg + * @details API for system configuration common to all parts including getting package type. + * @{ + */ + +/** @brief Enumeration to select Package Type*/ +typedef enum { + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +} mxc_sys_package_type_t; + +typedef struct { + uint8_t day, month, year; +} mxc_sys_date_t; + +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + +#ifdef __cplusplus +} +#endif + +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys_common.h new file mode 100644 index 00000000000..10ce2324201 --- /dev/null +++ b/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys_common.h @@ -0,0 +1,78 @@ +/** + * @file mxc_sys.h + * @brief System level header file. + */ + +/****************************************************************************** + * + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Analog Devices, Inc.), + * Copyright (C) 2023-2024 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. + * + ******************************************************************************/ + +#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ +#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ + +#include "mxc_device.h" +#include "gcr_regs.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup mxc_sys_common System Configuration (MXC_SYS) + * @ingroup syscfg + * @details API for system configuration common to all parts including getting package type. + * @{ + */ + +/** @brief Enumeration to select Package Type*/ +typedef enum { + MXC_SYS_PKG_TQFN = 1, + MXC_SYS_PKG_BGA = 2, + MXC_SYS_PKG_WLP = 3, + MXC_SYS_PKG_UNSET = 0xff +} mxc_sys_package_type_t; + +typedef struct { + uint8_t day, month, year; +} mxc_sys_date_t; + +/** + * @brief Reads the device package type. + * @returns Device Package Type (See mxc_sys_package_t for available options) + */ +mxc_sys_package_type_t MXC_SYS_GetPackageType(void); +/** + * @brief Set the package type. (Acts as an override to what is in Info Block) + * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) + * @returns E_NO_ERROR if package exists. + */ +int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); +/** + * @brief Get date of production test + * @param date_info Pointer to date information struct + * @returns E_NO_ERROR if date is valid. E_INVALID otherwise + */ +int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); + +#ifdef __cplusplus +} +#endif + +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ From 654b7083dff2a1eda48de7d0d3ce21555e0b1c4d Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:17:48 -0500 Subject: [PATCH 17/28] removed uneeded headers --- Libraries/PeriphDrivers/Source/SYS/sys_common.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Libraries/PeriphDrivers/Source/SYS/sys_common.c b/Libraries/PeriphDrivers/Source/SYS/sys_common.c index 4549a8ef331..a587eb9b17b 100644 --- a/Libraries/PeriphDrivers/Source/SYS/sys_common.c +++ b/Libraries/PeriphDrivers/Source/SYS/sys_common.c @@ -26,15 +26,11 @@ /* **** Includes **** */ #include +#include #include "mxc_device.h" #include "mxc_assert.h" #include "mxc_sys.h" #include "flc.h" -#include "mxc_delay.h" -#include "gcr_regs.h" -#include "fcr_regs.h" -#include "mcr_regs.h" -#include /** * @ingroup mxc_sys From 8eea9e4cc21fe5b56965bede1ad7179b4d8161b5 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:22:54 -0500 Subject: [PATCH 18/28] removed unused variable --- Libraries/PeriphDrivers/Source/SYS/sys_common.c | 1 - 1 file changed, 1 deletion(-) diff --git a/Libraries/PeriphDrivers/Source/SYS/sys_common.c b/Libraries/PeriphDrivers/Source/SYS/sys_common.c index a587eb9b17b..5f08e18b86a 100644 --- a/Libraries/PeriphDrivers/Source/SYS/sys_common.c +++ b/Libraries/PeriphDrivers/Source/SYS/sys_common.c @@ -47,7 +47,6 @@ /* **** Globals **** */ static mxc_sys_package_type_t pkg_type = MXC_SYS_PKG_UNSET; -bool info_block_unlocked = false; /* **** Functions **** */ /* ************************************************************************** */ From e805469c1dc88d74887868db8cbbfe87af3b5241 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:29:47 -0500 Subject: [PATCH 19/28] format --- Libraries/PeriphDrivers/Include/MAX32520/mxc_sys_common.h | 1 - Libraries/PeriphDrivers/Include/MAX32570/mxc_sys_common.h | 1 - Libraries/PeriphDrivers/Include/MAX32572/mxc_sys_common.h | 1 - Libraries/PeriphDrivers/Include/MAX32650/mxc_sys_common.h | 1 - Libraries/PeriphDrivers/Include/MAX32655/mxc_sys_common.h | 1 - Libraries/PeriphDrivers/Include/MAX32657/mxc_sys_common.h | 1 - Libraries/PeriphDrivers/Include/MAX32660/mxc_sys_common.h | 1 - Libraries/PeriphDrivers/Include/MAX32662/mxc_sys_common.h | 1 - Libraries/PeriphDrivers/Include/MAX32665/mxc_sys_common.h | 1 - Libraries/PeriphDrivers/Include/MAX32670/mxc_sys_common.h | 1 - Libraries/PeriphDrivers/Include/MAX32672/mxc_sys_common.h | 1 - Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h | 1 - Libraries/PeriphDrivers/Include/MAX32680/mxc_sys_common.h | 1 - Libraries/PeriphDrivers/Include/MAX32690/mxc_sys_common.h | 1 - Libraries/PeriphDrivers/Include/MAX78000/mxc_sys_common.h | 1 - Libraries/PeriphDrivers/Include/MAX78002/mxc_sys_common.h | 1 - 16 files changed, 16 deletions(-) diff --git a/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys_common.h index 10ce2324201..fd23f1d6221 100644 --- a/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys_common.h @@ -29,7 +29,6 @@ #include "mxc_device.h" #include "gcr_regs.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys_common.h index 10ce2324201..fd23f1d6221 100644 --- a/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys_common.h @@ -29,7 +29,6 @@ #include "mxc_device.h" #include "gcr_regs.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/Libraries/PeriphDrivers/Include/MAX32572/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32572/mxc_sys_common.h index 10ce2324201..fd23f1d6221 100644 --- a/Libraries/PeriphDrivers/Include/MAX32572/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32572/mxc_sys_common.h @@ -29,7 +29,6 @@ #include "mxc_device.h" #include "gcr_regs.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys_common.h index 10ce2324201..fd23f1d6221 100644 --- a/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys_common.h @@ -29,7 +29,6 @@ #include "mxc_device.h" #include "gcr_regs.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys_common.h index 10ce2324201..fd23f1d6221 100644 --- a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys_common.h @@ -29,7 +29,6 @@ #include "mxc_device.h" #include "gcr_regs.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys_common.h index 10ce2324201..fd23f1d6221 100644 --- a/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys_common.h @@ -29,7 +29,6 @@ #include "mxc_device.h" #include "gcr_regs.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys_common.h index 10ce2324201..fd23f1d6221 100644 --- a/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys_common.h @@ -29,7 +29,6 @@ #include "mxc_device.h" #include "gcr_regs.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys_common.h index 10ce2324201..fd23f1d6221 100644 --- a/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys_common.h @@ -29,7 +29,6 @@ #include "mxc_device.h" #include "gcr_regs.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys_common.h index 10ce2324201..fd23f1d6221 100644 --- a/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys_common.h @@ -29,7 +29,6 @@ #include "mxc_device.h" #include "gcr_regs.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys_common.h index 10ce2324201..fd23f1d6221 100644 --- a/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys_common.h @@ -29,7 +29,6 @@ #include "mxc_device.h" #include "gcr_regs.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys_common.h index 10ce2324201..fd23f1d6221 100644 --- a/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys_common.h @@ -29,7 +29,6 @@ #include "mxc_device.h" #include "gcr_regs.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h index 10ce2324201..fd23f1d6221 100644 --- a/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h @@ -29,7 +29,6 @@ #include "mxc_device.h" #include "gcr_regs.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys_common.h index 10ce2324201..fd23f1d6221 100644 --- a/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys_common.h @@ -29,7 +29,6 @@ #include "mxc_device.h" #include "gcr_regs.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys_common.h index 10ce2324201..fd23f1d6221 100644 --- a/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys_common.h @@ -29,7 +29,6 @@ #include "mxc_device.h" #include "gcr_regs.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys_common.h index 10ce2324201..fd23f1d6221 100644 --- a/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys_common.h @@ -29,7 +29,6 @@ #include "mxc_device.h" #include "gcr_regs.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys_common.h index 10ce2324201..fd23f1d6221 100644 --- a/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys_common.h @@ -29,7 +29,6 @@ #include "mxc_device.h" #include "gcr_regs.h" - #ifdef __cplusplus extern "C" { #endif From 8e474729d23a4f0e538b3eb6c6ce65134caf107e Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:48:53 -0500 Subject: [PATCH 20/28] update header guard comment --- Libraries/PeriphDrivers/Include/MAX32520/mxc_sys_common.h | 2 +- Libraries/PeriphDrivers/Include/MAX32570/mxc_sys_common.h | 2 +- Libraries/PeriphDrivers/Include/MAX32572/mxc_sys_common.h | 2 +- Libraries/PeriphDrivers/Include/MAX32650/mxc_sys_common.h | 2 +- Libraries/PeriphDrivers/Include/MAX32655/mxc_sys_common.h | 2 +- Libraries/PeriphDrivers/Include/MAX32657/mxc_sys_common.h | 2 +- Libraries/PeriphDrivers/Include/MAX32660/mxc_sys_common.h | 2 +- Libraries/PeriphDrivers/Include/MAX32662/mxc_sys_common.h | 2 +- Libraries/PeriphDrivers/Include/MAX32665/mxc_sys_common.h | 2 +- Libraries/PeriphDrivers/Include/MAX32670/mxc_sys_common.h | 2 +- Libraries/PeriphDrivers/Include/MAX32672/mxc_sys_common.h | 2 +- Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h | 2 +- Libraries/PeriphDrivers/Include/MAX32680/mxc_sys_common.h | 2 +- Libraries/PeriphDrivers/Include/MAX32690/mxc_sys_common.h | 2 +- Libraries/PeriphDrivers/Include/MAX78000/mxc_sys_common.h | 2 +- Libraries/PeriphDrivers/Include/MAX78002/mxc_sys_common.h | 2 +- Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys_common.h index fd23f1d6221..0985e250818 100644 --- a/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys_common.h index fd23f1d6221..0985e250818 100644 --- a/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32572/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32572/mxc_sys_common.h index fd23f1d6221..0985e250818 100644 --- a/Libraries/PeriphDrivers/Include/MAX32572/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32572/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys_common.h index fd23f1d6221..0985e250818 100644 --- a/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys_common.h index fd23f1d6221..0985e250818 100644 --- a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys_common.h index fd23f1d6221..0985e250818 100644 --- a/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys_common.h index fd23f1d6221..0985e250818 100644 --- a/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys_common.h index fd23f1d6221..0985e250818 100644 --- a/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys_common.h index fd23f1d6221..0985e250818 100644 --- a/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys_common.h index fd23f1d6221..0985e250818 100644 --- a/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys_common.h index fd23f1d6221..0985e250818 100644 --- a/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h index fd23f1d6221..0985e250818 100644 --- a/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys_common.h index fd23f1d6221..0985e250818 100644 --- a/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys_common.h index fd23f1d6221..0985e250818 100644 --- a/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys_common.h index fd23f1d6221..0985e250818 100644 --- a/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys_common.h index fd23f1d6221..0985e250818 100644 --- a/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h b/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h index fd23f1d6221..0985e250818 100644 --- a/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_H_ +#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ From 1c60a1c6e5648c2a110b199605511b6418b4f09b Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:50:00 -0500 Subject: [PATCH 21/28] rename sys common to mxc_sys_common --- .../PeriphDrivers/Source/SYS/{sys_common.c => mxc_sys_common.c} | 0 Libraries/PeriphDrivers/libPeriphDriver.mk | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename Libraries/PeriphDrivers/Source/SYS/{sys_common.c => mxc_sys_common.c} (100%) diff --git a/Libraries/PeriphDrivers/Source/SYS/sys_common.c b/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.c similarity index 100% rename from Libraries/PeriphDrivers/Source/SYS/sys_common.c rename to Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.c diff --git a/Libraries/PeriphDrivers/libPeriphDriver.mk b/Libraries/PeriphDrivers/libPeriphDriver.mk index ee4b135f683..d4993fa3d64 100644 --- a/Libraries/PeriphDrivers/libPeriphDriver.mk +++ b/Libraries/PeriphDrivers/libPeriphDriver.mk @@ -64,7 +64,7 @@ PERIPH_DRIVER_C_FILES += $(PERIPH_DIR)/Source/SYS/mxc_assert.c PERIPH_DRIVER_C_FILES += $(PERIPH_DIR)/Source/SYS/mxc_delay.c PERIPH_DRIVER_C_FILES += $(PERIPH_DIR)/Source/SYS/mxc_lock.c PERIPH_DRIVER_C_FILES += $(PERIPH_DIR)/Source/SYS/nvic_table.c -PERIPH_DRIVER_C_FILES += $(PERIPH_DIR)/Source/SYS/sys_common.c +PERIPH_DRIVER_C_FILES += $(PERIPH_DIR)/Source/SYS/mxc_sys_common.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_assert.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_delay.c From b03675b03c3661a7e645f51059f771502bda0e93 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:37:42 -0600 Subject: [PATCH 22/28] fix linter issues --- Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h index 0985e250818..da7147a3eb6 100644 --- a/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ +#endif // From 806dacb0001b6498c8699bf3c5c1666390a131d5 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:40:56 -0600 Subject: [PATCH 23/28] fixed header guard common --- Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h b/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h index 0985e250818..5c8a20c00e2 100644 --- a/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h @@ -74,4 +74,4 @@ int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); } #endif -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ +#endif // LIBRARIES_PERIPHDRIVERS_SOURCE_SYS_MXC_SYS_COMMON_H_ From 5873ce450a95c61b22d604c8b2d69bc656e02bb4 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Fri, 8 Nov 2024 09:25:25 -0600 Subject: [PATCH 24/28] added sys common to IPATH --- Libraries/PeriphDrivers/periphdriver.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/PeriphDrivers/periphdriver.mk b/Libraries/PeriphDrivers/periphdriver.mk index ec7116ebe86..72220937ff1 100644 --- a/Libraries/PeriphDrivers/periphdriver.mk +++ b/Libraries/PeriphDrivers/periphdriver.mk @@ -84,7 +84,7 @@ export COMPILER # export MFLOAT_ABI include ${PERIPH_DRIVER_DIR}/$(TARGET_LC)_files.mk -IPATH += ${PERIPH_DRIVER_INCLUDE_DIR} ${PERIPH_DRIVER_DIR}/SYS/Source +IPATH += ${PERIPH_DRIVER_INCLUDE_DIR} ${PERIPH_DRIVER_DIR}/Source/SYS ifeq "$(PD_LIBRARY_VARIANT)" "" PERIPH_DRIVER_LIB_FILENAME := libPeriphDriver From c4a4abd26573a043fa48eb28f2cbff3bd4f40f27 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Fri, 8 Nov 2024 09:26:38 -0600 Subject: [PATCH 25/28] remove sys common from individual parts --- .../Include/MAX32520/mxc_sys_common.h | 77 ------------------- .../Include/MAX32570/mxc_sys_common.h | 77 ------------------- .../Include/MAX32572/mxc_sys_common.h | 77 ------------------- .../Include/MAX32650/mxc_sys_common.h | 77 ------------------- .../Include/MAX32655/mxc_sys_common.h | 77 ------------------- .../Include/MAX32657/mxc_sys_common.h | 77 ------------------- .../Include/MAX32660/mxc_sys_common.h | 77 ------------------- .../Include/MAX32662/mxc_sys_common.h | 77 ------------------- .../Include/MAX32665/mxc_sys_common.h | 77 ------------------- .../Include/MAX32670/mxc_sys_common.h | 77 ------------------- .../Include/MAX32672/mxc_sys_common.h | 77 ------------------- .../Include/MAX32675/mxc_sys_common.h | 77 ------------------- .../Include/MAX32680/mxc_sys_common.h | 77 ------------------- .../Include/MAX32690/mxc_sys_common.h | 77 ------------------- .../Include/MAX78000/mxc_sys_common.h | 77 ------------------- .../Include/MAX78002/mxc_sys_common.h | 77 ------------------- 16 files changed, 1232 deletions(-) delete mode 100644 Libraries/PeriphDrivers/Include/MAX32520/mxc_sys_common.h delete mode 100644 Libraries/PeriphDrivers/Include/MAX32570/mxc_sys_common.h delete mode 100644 Libraries/PeriphDrivers/Include/MAX32572/mxc_sys_common.h delete mode 100644 Libraries/PeriphDrivers/Include/MAX32650/mxc_sys_common.h delete mode 100644 Libraries/PeriphDrivers/Include/MAX32655/mxc_sys_common.h delete mode 100644 Libraries/PeriphDrivers/Include/MAX32657/mxc_sys_common.h delete mode 100644 Libraries/PeriphDrivers/Include/MAX32660/mxc_sys_common.h delete mode 100644 Libraries/PeriphDrivers/Include/MAX32662/mxc_sys_common.h delete mode 100644 Libraries/PeriphDrivers/Include/MAX32665/mxc_sys_common.h delete mode 100644 Libraries/PeriphDrivers/Include/MAX32670/mxc_sys_common.h delete mode 100644 Libraries/PeriphDrivers/Include/MAX32672/mxc_sys_common.h delete mode 100644 Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h delete mode 100644 Libraries/PeriphDrivers/Include/MAX32680/mxc_sys_common.h delete mode 100644 Libraries/PeriphDrivers/Include/MAX32690/mxc_sys_common.h delete mode 100644 Libraries/PeriphDrivers/Include/MAX78000/mxc_sys_common.h delete mode 100644 Libraries/PeriphDrivers/Include/MAX78002/mxc_sys_common.h diff --git a/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys_common.h deleted file mode 100644 index 0985e250818..00000000000 --- a/Libraries/PeriphDrivers/Include/MAX32520/mxc_sys_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file mxc_sys.h - * @brief System level header file. - */ - -/****************************************************************************** - * - * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by - * Analog Devices, Inc.), - * Copyright (C) 2023-2024 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. - * - ******************************************************************************/ - -#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ -#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ - -#include "mxc_device.h" -#include "gcr_regs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup mxc_sys_common System Configuration (MXC_SYS) - * @ingroup syscfg - * @details API for system configuration common to all parts including getting package type. - * @{ - */ - -/** @brief Enumeration to select Package Type*/ -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - -#ifdef __cplusplus -} -#endif - -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys_common.h deleted file mode 100644 index 0985e250818..00000000000 --- a/Libraries/PeriphDrivers/Include/MAX32570/mxc_sys_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file mxc_sys.h - * @brief System level header file. - */ - -/****************************************************************************** - * - * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by - * Analog Devices, Inc.), - * Copyright (C) 2023-2024 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. - * - ******************************************************************************/ - -#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ -#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ - -#include "mxc_device.h" -#include "gcr_regs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup mxc_sys_common System Configuration (MXC_SYS) - * @ingroup syscfg - * @details API for system configuration common to all parts including getting package type. - * @{ - */ - -/** @brief Enumeration to select Package Type*/ -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - -#ifdef __cplusplus -} -#endif - -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32572/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32572/mxc_sys_common.h deleted file mode 100644 index 0985e250818..00000000000 --- a/Libraries/PeriphDrivers/Include/MAX32572/mxc_sys_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file mxc_sys.h - * @brief System level header file. - */ - -/****************************************************************************** - * - * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by - * Analog Devices, Inc.), - * Copyright (C) 2023-2024 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. - * - ******************************************************************************/ - -#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ -#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ - -#include "mxc_device.h" -#include "gcr_regs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup mxc_sys_common System Configuration (MXC_SYS) - * @ingroup syscfg - * @details API for system configuration common to all parts including getting package type. - * @{ - */ - -/** @brief Enumeration to select Package Type*/ -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - -#ifdef __cplusplus -} -#endif - -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys_common.h deleted file mode 100644 index 0985e250818..00000000000 --- a/Libraries/PeriphDrivers/Include/MAX32650/mxc_sys_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file mxc_sys.h - * @brief System level header file. - */ - -/****************************************************************************** - * - * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by - * Analog Devices, Inc.), - * Copyright (C) 2023-2024 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. - * - ******************************************************************************/ - -#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ -#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ - -#include "mxc_device.h" -#include "gcr_regs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup mxc_sys_common System Configuration (MXC_SYS) - * @ingroup syscfg - * @details API for system configuration common to all parts including getting package type. - * @{ - */ - -/** @brief Enumeration to select Package Type*/ -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - -#ifdef __cplusplus -} -#endif - -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys_common.h deleted file mode 100644 index 0985e250818..00000000000 --- a/Libraries/PeriphDrivers/Include/MAX32655/mxc_sys_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file mxc_sys.h - * @brief System level header file. - */ - -/****************************************************************************** - * - * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by - * Analog Devices, Inc.), - * Copyright (C) 2023-2024 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. - * - ******************************************************************************/ - -#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ -#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ - -#include "mxc_device.h" -#include "gcr_regs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup mxc_sys_common System Configuration (MXC_SYS) - * @ingroup syscfg - * @details API for system configuration common to all parts including getting package type. - * @{ - */ - -/** @brief Enumeration to select Package Type*/ -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - -#ifdef __cplusplus -} -#endif - -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys_common.h deleted file mode 100644 index 0985e250818..00000000000 --- a/Libraries/PeriphDrivers/Include/MAX32657/mxc_sys_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file mxc_sys.h - * @brief System level header file. - */ - -/****************************************************************************** - * - * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by - * Analog Devices, Inc.), - * Copyright (C) 2023-2024 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. - * - ******************************************************************************/ - -#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ -#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ - -#include "mxc_device.h" -#include "gcr_regs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup mxc_sys_common System Configuration (MXC_SYS) - * @ingroup syscfg - * @details API for system configuration common to all parts including getting package type. - * @{ - */ - -/** @brief Enumeration to select Package Type*/ -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - -#ifdef __cplusplus -} -#endif - -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys_common.h deleted file mode 100644 index 0985e250818..00000000000 --- a/Libraries/PeriphDrivers/Include/MAX32660/mxc_sys_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file mxc_sys.h - * @brief System level header file. - */ - -/****************************************************************************** - * - * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by - * Analog Devices, Inc.), - * Copyright (C) 2023-2024 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. - * - ******************************************************************************/ - -#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ -#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ - -#include "mxc_device.h" -#include "gcr_regs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup mxc_sys_common System Configuration (MXC_SYS) - * @ingroup syscfg - * @details API for system configuration common to all parts including getting package type. - * @{ - */ - -/** @brief Enumeration to select Package Type*/ -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - -#ifdef __cplusplus -} -#endif - -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys_common.h deleted file mode 100644 index 0985e250818..00000000000 --- a/Libraries/PeriphDrivers/Include/MAX32662/mxc_sys_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file mxc_sys.h - * @brief System level header file. - */ - -/****************************************************************************** - * - * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by - * Analog Devices, Inc.), - * Copyright (C) 2023-2024 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. - * - ******************************************************************************/ - -#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ -#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ - -#include "mxc_device.h" -#include "gcr_regs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup mxc_sys_common System Configuration (MXC_SYS) - * @ingroup syscfg - * @details API for system configuration common to all parts including getting package type. - * @{ - */ - -/** @brief Enumeration to select Package Type*/ -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - -#ifdef __cplusplus -} -#endif - -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys_common.h deleted file mode 100644 index 0985e250818..00000000000 --- a/Libraries/PeriphDrivers/Include/MAX32665/mxc_sys_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file mxc_sys.h - * @brief System level header file. - */ - -/****************************************************************************** - * - * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by - * Analog Devices, Inc.), - * Copyright (C) 2023-2024 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. - * - ******************************************************************************/ - -#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ -#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ - -#include "mxc_device.h" -#include "gcr_regs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup mxc_sys_common System Configuration (MXC_SYS) - * @ingroup syscfg - * @details API for system configuration common to all parts including getting package type. - * @{ - */ - -/** @brief Enumeration to select Package Type*/ -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - -#ifdef __cplusplus -} -#endif - -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys_common.h deleted file mode 100644 index 0985e250818..00000000000 --- a/Libraries/PeriphDrivers/Include/MAX32670/mxc_sys_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file mxc_sys.h - * @brief System level header file. - */ - -/****************************************************************************** - * - * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by - * Analog Devices, Inc.), - * Copyright (C) 2023-2024 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. - * - ******************************************************************************/ - -#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ -#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ - -#include "mxc_device.h" -#include "gcr_regs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup mxc_sys_common System Configuration (MXC_SYS) - * @ingroup syscfg - * @details API for system configuration common to all parts including getting package type. - * @{ - */ - -/** @brief Enumeration to select Package Type*/ -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - -#ifdef __cplusplus -} -#endif - -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys_common.h deleted file mode 100644 index 0985e250818..00000000000 --- a/Libraries/PeriphDrivers/Include/MAX32672/mxc_sys_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file mxc_sys.h - * @brief System level header file. - */ - -/****************************************************************************** - * - * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by - * Analog Devices, Inc.), - * Copyright (C) 2023-2024 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. - * - ******************************************************************************/ - -#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ -#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ - -#include "mxc_device.h" -#include "gcr_regs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup mxc_sys_common System Configuration (MXC_SYS) - * @ingroup syscfg - * @details API for system configuration common to all parts including getting package type. - * @{ - */ - -/** @brief Enumeration to select Package Type*/ -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - -#ifdef __cplusplus -} -#endif - -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h deleted file mode 100644 index da7147a3eb6..00000000000 --- a/Libraries/PeriphDrivers/Include/MAX32675/mxc_sys_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file mxc_sys.h - * @brief System level header file. - */ - -/****************************************************************************** - * - * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by - * Analog Devices, Inc.), - * Copyright (C) 2023-2024 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. - * - ******************************************************************************/ - -#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ -#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ - -#include "mxc_device.h" -#include "gcr_regs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup mxc_sys_common System Configuration (MXC_SYS) - * @ingroup syscfg - * @details API for system configuration common to all parts including getting package type. - * @{ - */ - -/** @brief Enumeration to select Package Type*/ -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - -#ifdef __cplusplus -} -#endif - -#endif // diff --git a/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys_common.h deleted file mode 100644 index 0985e250818..00000000000 --- a/Libraries/PeriphDrivers/Include/MAX32680/mxc_sys_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file mxc_sys.h - * @brief System level header file. - */ - -/****************************************************************************** - * - * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by - * Analog Devices, Inc.), - * Copyright (C) 2023-2024 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. - * - ******************************************************************************/ - -#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ -#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ - -#include "mxc_device.h" -#include "gcr_regs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup mxc_sys_common System Configuration (MXC_SYS) - * @ingroup syscfg - * @details API for system configuration common to all parts including getting package type. - * @{ - */ - -/** @brief Enumeration to select Package Type*/ -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - -#ifdef __cplusplus -} -#endif - -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys_common.h deleted file mode 100644 index 0985e250818..00000000000 --- a/Libraries/PeriphDrivers/Include/MAX32690/mxc_sys_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file mxc_sys.h - * @brief System level header file. - */ - -/****************************************************************************** - * - * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by - * Analog Devices, Inc.), - * Copyright (C) 2023-2024 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. - * - ******************************************************************************/ - -#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ -#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ - -#include "mxc_device.h" -#include "gcr_regs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup mxc_sys_common System Configuration (MXC_SYS) - * @ingroup syscfg - * @details API for system configuration common to all parts including getting package type. - * @{ - */ - -/** @brief Enumeration to select Package Type*/ -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - -#ifdef __cplusplus -} -#endif - -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys_common.h deleted file mode 100644 index 0985e250818..00000000000 --- a/Libraries/PeriphDrivers/Include/MAX78000/mxc_sys_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file mxc_sys.h - * @brief System level header file. - */ - -/****************************************************************************** - * - * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by - * Analog Devices, Inc.), - * Copyright (C) 2023-2024 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. - * - ******************************************************************************/ - -#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ -#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ - -#include "mxc_device.h" -#include "gcr_regs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup mxc_sys_common System Configuration (MXC_SYS) - * @ingroup syscfg - * @details API for system configuration common to all parts including getting package type. - * @{ - */ - -/** @brief Enumeration to select Package Type*/ -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - -#ifdef __cplusplus -} -#endif - -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ diff --git a/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys_common.h b/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys_common.h deleted file mode 100644 index 0985e250818..00000000000 --- a/Libraries/PeriphDrivers/Include/MAX78002/mxc_sys_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file mxc_sys.h - * @brief System level header file. - */ - -/****************************************************************************** - * - * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by - * Analog Devices, Inc.), - * Copyright (C) 2023-2024 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. - * - ******************************************************************************/ - -#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ -#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ - -#include "mxc_device.h" -#include "gcr_regs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup mxc_sys_common System Configuration (MXC_SYS) - * @ingroup syscfg - * @details API for system configuration common to all parts including getting package type. - * @{ - */ - -/** @brief Enumeration to select Package Type*/ -typedef enum { - MXC_SYS_PKG_TQFN = 1, - MXC_SYS_PKG_BGA = 2, - MXC_SYS_PKG_WLP = 3, - MXC_SYS_PKG_UNSET = 0xff -} mxc_sys_package_type_t; - -typedef struct { - uint8_t day, month, year; -} mxc_sys_date_t; - -/** - * @brief Reads the device package type. - * @returns Device Package Type (See mxc_sys_package_t for available options) - */ -mxc_sys_package_type_t MXC_SYS_GetPackageType(void); -/** - * @brief Set the package type. (Acts as an override to what is in Info Block) - * @param new_pkg_type Device Package Type (See mxc_sys_package_t for available options) - * @returns E_NO_ERROR if package exists. - */ -int MXC_SYS_SetPackageType(mxc_sys_package_type_t new_pkg_type); -/** - * @brief Get date of production test - * @param date_info Pointer to date information struct - * @returns E_NO_ERROR if date is valid. E_INVALID otherwise - */ -int MXC_SYS_GetTestDate(mxc_sys_date_t *date_info); - -#ifdef __cplusplus -} -#endif - -#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_SYS_COMMON_H_ From 6efb15c599192081101967e2ffaa918840d799c2 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Fri, 8 Nov 2024 09:31:11 -0600 Subject: [PATCH 26/28] lint --- Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h b/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h index 5c8a20c00e2..e8f659fa27a 100644 --- a/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h +++ b/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.h @@ -23,8 +23,8 @@ * ******************************************************************************/ -#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ -#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MXC_SYS_COMMON_H_ +#ifndef LIBRARIES_PERIPHDRIVERS_SOURCE_SYS_MXC_SYS_COMMON_H_ +#define LIBRARIES_PERIPHDRIVERS_SOURCE_SYS_MXC_SYS_COMMON_H_ #include "mxc_device.h" #include "gcr_regs.h" From 25e7711156c63adbcf039d6c0de44d4f6c50f763 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Fri, 8 Nov 2024 15:38:45 -0600 Subject: [PATCH 27/28] include .h in .c --- Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.c b/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.c index 5f08e18b86a..7a310ef8adf 100644 --- a/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.c +++ b/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.c @@ -29,7 +29,7 @@ #include #include "mxc_device.h" #include "mxc_assert.h" -#include "mxc_sys.h" +#include "mxc_sys_common.h" #include "flc.h" /** From 4a4cfefe19febbeb4ba1547b603694b55ba7e12e Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Fri, 8 Nov 2024 15:39:26 -0600 Subject: [PATCH 28/28] include mxc-sys.h --- Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.c b/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.c index 7a310ef8adf..c6c2a077c74 100644 --- a/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.c +++ b/Libraries/PeriphDrivers/Source/SYS/mxc_sys_common.c @@ -30,6 +30,7 @@ #include "mxc_device.h" #include "mxc_assert.h" #include "mxc_sys_common.h" +#include "mxc_sys.h" #include "flc.h" /**