Skip to content

Imx93 sar adc support #573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#### device spepcific drivers
include(${SdkRootDirPath}/devices/arm/device_header.cmake)
mcux_add_cmakelists(${SdkRootDirPath}/devices/i.MX/i.MX93/MIMX9301/drivers)
mcux_add_cmakelists(${SdkRootDirPath}/${device_root}/i.MX/i.MX93/MIMX9301/drivers)

#### i.MX shared drivers/components/middlewares, project segments
include(${SdkRootDirPath}/devices/i.MX/shared.cmake)
13 changes: 8 additions & 5 deletions mcux/mcux-sdk-ng/devices/i.MX/i.MX93/MIMX9301/MIMX9301_cm33.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
** Keil ARM C/C++ Compiler
**
** Reference manual: IMX93RM, Internal, November. 2021
** Version: rev. 1.0, 2021-11-16
** Build: b240814
** Version: rev. 2.0, 2024-10-29
** Build: b250521
**
** Abstract:
** CMSIS Peripheral Access Layer for MIMX9301_cm33
**
** Copyright 1997-2016 Freescale Semiconductor, Inc.
** Copyright 2016-2024 NXP
** Copyright 2016-2025 NXP
** SPDX-License-Identifier: BSD-3-Clause
**
** http: www.nxp.com
Expand All @@ -24,14 +24,17 @@
** Revisions:
** - rev. 1.0 (2021-11-16)
** Initial version.
** - rev. 2.0 (2024-10-29)
** Change the device header file from single flat file to multiple files based on peripherals,
** each peripheral with dedicated header file located in periphN folder.
**
** ###################################################################
*/

/*!
* @file MIMX9301_cm33.h
* @version 1.0
* @date 2021-11-16
* @version 2.0
* @date 2024-10-29
* @brief CMSIS Peripheral Access Layer for MIMX9301_cm33
*
* CMSIS Peripheral Access Layer for MIMX9301_cm33
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
** Keil ARM C/C++ Compiler
**
** Reference manual: IMX93RM, Internal, November. 2021
** Version: rev. 1.0, 2021-11-16
** Build: b240823
** Version: rev. 2.0, 2024-10-29
** Build: b250521
**
** Abstract:
** CMSIS Peripheral Access Layer for MIMX9301_cm33
**
** Copyright 1997-2016 Freescale Semiconductor, Inc.
** Copyright 2016-2024 NXP
** Copyright 2016-2025 NXP
** SPDX-License-Identifier: BSD-3-Clause
**
** http: www.nxp.com
Expand All @@ -24,14 +24,17 @@
** Revisions:
** - rev. 1.0 (2021-11-16)
** Initial version.
** - rev. 2.0 (2024-10-29)
** Change the device header file from single flat file to multiple files based on peripherals,
** each peripheral with dedicated header file located in periphN folder.
**
** ###################################################################
*/

/*!
* @file MIMX9301_cm33_COMMON.h
* @version 1.0
* @date 2021-11-16
* @version 2.0
* @date 2024-10-29
* @brief CMSIS Peripheral Access Layer for MIMX9301_cm33
*
* CMSIS Peripheral Access Layer for MIMX9301_cm33
Expand All @@ -42,7 +45,7 @@

/** Memory map major version (memory maps with equal major version number are
* compatible) */
#define MCU_MEM_MAP_VERSION 0x0100U
#define MCU_MEM_MAP_VERSION 0x0200U
/** Memory map minor version */
#define MCU_MEM_MAP_VERSION_MINOR 0x0000U

Expand Down Expand Up @@ -375,7 +378,9 @@ typedef enum IRQn {
*/ /* end of group Cortex_Core_Configuration */


#ifndef MIMX9301_cm33_SERIES
#define MIMX9301_cm33_SERIES
#endif
/* CPU specific feature definitions */
#include "MIMX9301_cm33_features.h"

Expand Down Expand Up @@ -2980,13 +2985,13 @@ typedef enum IRQn {
/** Peripheral TPM6 base pointer */
#define TPM6_NS ((TPM_Type *)TPM6_BASE_NS)
/** Array initializer of TPM peripheral base addresses */
#define TPM_BASE_ADDRS { TPM1_BASE, TPM2_BASE, TPM3_BASE, TPM4_BASE, TPM5_BASE, TPM6_BASE }
#define TPM_BASE_ADDRS { 0u, TPM1_BASE, TPM2_BASE, TPM3_BASE, TPM4_BASE, TPM5_BASE, TPM6_BASE }
/** Array initializer of TPM peripheral base pointers */
#define TPM_BASE_PTRS { TPM1, TPM2, TPM3, TPM4, TPM5, TPM6 }
#define TPM_BASE_PTRS { (TPM_Type *)0u, TPM1, TPM2, TPM3, TPM4, TPM5, TPM6 }
/** Array initializer of TPM peripheral base addresses */
#define TPM_BASE_ADDRS_NS { TPM1_BASE_NS, TPM2_BASE_NS, TPM3_BASE_NS, TPM4_BASE_NS, TPM5_BASE_NS, TPM6_BASE_NS }
#define TPM_BASE_ADDRS_NS { 0u, TPM1_BASE_NS, TPM2_BASE_NS, TPM3_BASE_NS, TPM4_BASE_NS, TPM5_BASE_NS, TPM6_BASE_NS }
/** Array initializer of TPM peripheral base pointers */
#define TPM_BASE_PTRS_NS { TPM1_NS, TPM2_NS, TPM3_NS, TPM4_NS, TPM5_NS, TPM6_NS }
#define TPM_BASE_PTRS_NS { (TPM_Type *)0u, TPM1_NS, TPM2_NS, TPM3_NS, TPM4_NS, TPM5_NS, TPM6_NS }
#else
/** Peripheral TPM1 base address */
#define TPM1_BASE (0x44310000u)
Expand All @@ -3013,12 +3018,12 @@ typedef enum IRQn {
/** Peripheral TPM6 base pointer */
#define TPM6 ((TPM_Type *)TPM6_BASE)
/** Array initializer of TPM peripheral base addresses */
#define TPM_BASE_ADDRS { TPM1_BASE, TPM2_BASE, TPM3_BASE, TPM4_BASE, TPM5_BASE, TPM6_BASE }
#define TPM_BASE_ADDRS { 0u, TPM1_BASE, TPM2_BASE, TPM3_BASE, TPM4_BASE, TPM5_BASE, TPM6_BASE }
/** Array initializer of TPM peripheral base pointers */
#define TPM_BASE_PTRS { TPM1, TPM2, TPM3, TPM4, TPM5, TPM6 }
#define TPM_BASE_PTRS { (TPM_Type *)0u, TPM1, TPM2, TPM3, TPM4, TPM5, TPM6 }
#endif
/** Interrupt vectors for the TPM peripheral type */
#define TPM_IRQS { TPM1_IRQn, TPM2_IRQn, TPM3_IRQn, TPM4_IRQn, TPM5_IRQn, TPM6_IRQn }
#define TPM_IRQS { NotAvail_IRQn, TPM1_IRQn, TPM2_IRQn, TPM3_IRQn, TPM4_IRQn, TPM5_IRQn, TPM6_IRQn }

/* TRDC_MBC0 - Peripheral instance base addresses */
#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*
** ###################################################################
** Version: rev. 1.0, 2021-11-16
** Build: b241030
** Build: b250623
**
** Abstract:
** Chip specific module features.
**
** Copyright 2016 Freescale Semiconductor, Inc.
** Copyright 2016-2024 NXP
** Copyright 2016-2025 NXP
** SPDX-License-Identifier: BSD-3-Clause
**
** http: www.nxp.com
Expand All @@ -25,6 +25,8 @@

/* SOC module features */

/* @brief ADC availability on the SoC. */
#define FSL_FEATURE_SOC_ADC_COUNT (1)
/* @brief AXBS availability on the SoC. */
#define FSL_FEATURE_SOC_AXBS_COUNT (1)
/* @brief BBNSM availability on the SoC. */
Expand Down Expand Up @@ -100,10 +102,17 @@
/* @brief XCACHE availability on the SoC. */
#define FSL_FEATURE_SOC_XCACHE_COUNT (2)

/* ADC module features */

/* @brief Channel group counts of ADC. */
#define FSL_FEATURE_ADC_CHANNEL_GROUPS_COUNT (2)
/* @brief Threshold counts of ADC. */
#define FSL_FEATURE_ADC_THRESHOLDS_COUNT (8)
/* @brief Self-test threshold counts of ADC. */
#define FSL_FEATURE_ADC_SELF_TEST_THRESHOLDS_COUNT (6)

/* FLEXCAN module features */

/* @brief Has more than 64 MBs. */
#define FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB (1)
/* @brief Message buffer size */
#define FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(x) (96)
/* @brief Has doze mode support (register bit field MCR[DOZE]). */
Expand Down Expand Up @@ -152,12 +161,36 @@
#define FSL_FEATURE_FLEXCAN_HAS_PN_MODE (0)
/* @brief Has Enhanced Rx FIFO. */
#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO (1)
/* @brief Has Enhanced Rx FIFO. */
#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_ENHANCED_RX_FIFOn(x) (1)
/* @brief Enhanced Rx FIFO size (Indicates how many CAN FD messages can be stored). */
#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_SIZE (20)
/* @brief The number of enhanced Rx FIFO filter element registers. */
#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_FILTER_MAX_NUMBER (128)
/* @brief Does not support Supervisor Mode (bitfield MCR[SUPV]. */
#define FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT (0)
/* @brief Has more than 64 MBs. */
#define FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB (1)
/* @brief Does not support self wake feature(bitfield MCR[SLFWAK]) */
#define FSL_FEATURE_FLEXCAN_HAS_NO_SLFWAK_SUPPORT (0)
/* @brief Has external time tick source (bitfield CTRL2[TIMER_SRC]). */
#define FSL_FEATURE_FLEXCAN_HAS_EXTERNAL_TIME_TICK (1)
/* @brief Instance has external time tick source (register bit field CTRL2[TIMER_SRC]). */
#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_EXTERNAL_TIME_TICKn(x) (1)
/* @brief Has Time Stamp Capture Point(bitfield CTRL2[TSTAMPCAP]). */
#define FSL_FEATURE_FLEXCAN_HAS_HIGH_RESOLUTION_TIMESTAMP (1)
/* @brief Instance has Pretended Networking option (register bit field MCR[PNET_EN]). */
#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_PN_MODEn(x) (0)
/* @brief FlexCAN maximum data rate. */
#define FSL_FEATURE_FLEXCAN_MAX_CANFD_BITRATE (8000000)
/* @brief Support payload endianness selection (bitfield CTRL2[PES]). */
#define FSL_FEATURE_FLEXCAN_HAS_ENDIANNESS_SELECTION (0)
/* @brief Enter Freeze mode before entering Disable and Stop mode. */
#define FSL_FEATURE_FLEXCAN_ENTER_FREEZE_MODE (0)
/* @brief Is affected by errata with ID 8341 (FlexCAN: Entering Freeze Mode or Low Power Mode from Normal Mode can cause the FlexCAN module to stop operating). */
#define FSL_FEATURE_FLEXCAN_HAS_ERRATA_8341 (0)
/* @brief Is affected by errata with ID 050443 (FlexCAN: : Receive Message Buffers may have its CODE Field corrupted if the Receive FIFO function is used in Classical CAN mode). */
#define FSL_FEATURE_FLEXCAN_HAS_ERRATA_050443 (0)

/* EDMA module features */

Expand Down Expand Up @@ -294,12 +327,14 @@

/* FLEXIO module features */

/* @brief Has DOZEN bit(CTRL[DOZEN]) */
#define FSL_FEATURE_FLEXIO_HAS_DOZE_MODE_SUPPORT (1)
/* @brief FLEXIO support reset from RSTCTL */
#define FSL_FEATURE_FLEXIO_HAS_RESET (0)
/* @brief Has Shifter Status Register (FLEXIO_SHIFTSTAT) */
#define FSL_FEATURE_FLEXIO_HAS_SHIFTER_STATUS (1)
/* @brief Has Pin Data Input Register (FLEXIO_PIN) */
#define FSL_FEATURE_FLEXIO_HAS_PIN_STATUS (1)
/* @brief Has pin input output related registers */
#define FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER (1)
/* @brief Has Shifter Buffer N Nibble Byte Swapped Register (FLEXIO_SHIFTBUFNBSn) */
#define FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP (1)
/* @brief Has Shifter Buffer N Half Word Swapped Register (FLEXIO_SHIFTBUFHWSn) */
Expand All @@ -316,10 +351,12 @@
#define FSL_FEATURE_FLEXIO_VERID_RESET_VALUE (0x2010003)
/* @brief Reset value of the FLEXIO_PARAM register */
#define FSL_FEATURE_FLEXIO_PARAM_RESET_VALUE (0x4200808)
/* @brief Represent the bit width of the TIMDCE field (FLEXIO_TIMCFGLn[TIMDEC]) */
#define FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH (3)
/* @brief Flexio DMA request base channel */
#define FSL_FEATURE_FLEXIO_DMA_REQUEST_BASE_CHANNEL (0)
/* @brief Represent the bit width of the TIMDCE field (FLEXIO_TIMCFGLn[TIMDEC]) */
#define FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH (3)
/* @brief Has pin input output related registers */
#define FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER (1)

/* FLEXSPI module features */

Expand Down Expand Up @@ -377,6 +414,18 @@
#define FSL_FEATURE_I3C_HAS_HDROK (1)
/* @brief SOC doesn't support slave IBI/MR/HJ. */
#define FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ (0)
/* @brief Has ERRATA_051617. */
#define FSL_FEATURE_I3C_HAS_ERRATA_051617 (0)
/* @brief Has ERRATA_052123. */
#define FSL_FEATURE_I3C_HAS_ERRATA_052123 (0)
/* @brief Has ERRATA_052086. */
#define FSL_FEATURE_I3C_HAS_ERRATA_052086 (0)
/* @brief Has IBI bytes. */
#define FSL_FEATURE_I3C_HAS_IBI_PAYLOAD_SIZE_OPTIONAL_BYTE (0)
/* @brief Has SCL delay after START. */
#define FSL_FEATURE_I3C_HAS_START_SCL_DELAY (1)
/* @brief Has no the master write data register for DMA. */
#define FSL_FEATURE_I3C_HAS_NO_MASTER_DMA_WDATA_REG (0)

/* XCACHE module features */

Expand All @@ -391,6 +440,8 @@
#define FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(x) (1)
/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */
#define FSL_FEATURE_LPI2C_FIFO_SIZEn(x) (8)
/* @brief Has dedicated interrupt for master and slave. */
#define FSL_FEATURE_LPI2C_HAS_ROLE_SPLIT_IRQ (0)

/* LPIT module features */

Expand All @@ -403,15 +454,15 @@

/* LPSPI module features */

/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */
/* @brief Capacity (number of entries) of the transmit/receive FIFO. */
#define FSL_FEATURE_LPSPI_FIFO_SIZEn(x) (8)
/* @brief Has separate DMA RX and TX requests. */
#define FSL_FEATURE_LPSPI_HAS_SEPARATE_DMA_RX_TX_REQn(x) (1)
/* @brief Has CCR1 (related to existence of registers CCR1). */
#define FSL_FEATURE_LPSPI_HAS_CCR1 (1)
/* @brief Has no PCSCFG bit in CFGR1 register */
/* @brief Has no PCSCFG bit in CFGR1 register. */
#define FSL_FEATURE_LPSPI_HAS_NO_PCSCFG (1)
/* @brief Has no WIDTH bits in TCR register */
/* @brief Has no WIDTH bits in TCR register. */
#define FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH (1)

/* LPTMR module features */
Expand Down Expand Up @@ -497,12 +548,18 @@
#define FSL_FEATURE_LPUART_HAS_GLOBAL (1)
/* @brief Has LPUART_PINCFG. */
#define FSL_FEATURE_LPUART_HAS_PINCFG (1)
/* @brief Belong to LPFLEXCOMM */
#define FSL_FEATURE_LPUART_IS_LPFLEXCOMM (0)
/* @brief Has register MODEM Control. */
#define FSL_FEATURE_LPUART_HAS_MCR (1)
/* @brief Has register Half Duplex Control. */
#define FSL_FEATURE_LPUART_HAS_HDCR (1)
/* @brief Has register Timeout. */
#define FSL_FEATURE_LPUART_HAS_TIMEOUT (1)
/* @brief UART support swap TX and RX (has bit CTRL[SWAP]). */
#define FSL_FEATURE_LPUART_HAS_CTRL_SWAP (0)
/* @brief UART support receive rts configuration (has bit MODIR[RTSWATER]). */
#define FSL_FEATURE_LPUART_HAS_MODIR_RTSWATER (1)

/* MEMORY module features */

Expand Down Expand Up @@ -621,12 +678,16 @@
#define FSL_FEATURE_SAI_HAS_MDR (0)
/* @brief Has support the BCLK bypass mode when BCLK = MCLK. */
#define FSL_FEATURE_SAI_HAS_BCLK_BYPASS (1)
/* @brief Has DIV bit fields of MCR register (register bit fields MCR[DIV]. */
/* @brief Has DIV bit fields of MCR register (register bit fields MCR[DIV]). */
#define FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV (1)
/* @brief Support Channel Mode (register bit fields TCR4[CHMOD]). */
#define FSL_FEATURE_SAI_HAS_CHANNEL_MODE (1)
/* @brief Support synchronous with another SAI. */
#define FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI (0)
/* @brief Has Bit Clock Swap option (register bit fields RCR2[BCS]) */
#define FSL_FEATURE_SAI_HAS_BIT_CLOCK_SWAP (1)
/* @brief SAI5 and SAI6 share one irq number. */
#define FSL_FEATURE_SAI_SAI5_SAI6_SHARE_IRQ (0)

/* SEMA42 module features */

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2014-2016 Freescale Semiconductor, Inc.
* Copyright 2016-2024 NXP
* Copyright 2016-2025 NXP
* SPDX-License-Identifier: BSD-3-Clause
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
** Keil ARM C/C++ Compiler
**
** Reference manual: IMX93RM, Internal, November. 2021
** Version: rev. 1.0, 2021-11-16
** Build: b231019
** Version: rev. 2.0, 2024-10-29
** Build: b250521
**
** Abstract:
** Provides a system configuration function and a global variable that
** contains the system frequency. It configures the device and initializes
** the oscillator (PLL) that is part of the microcontroller device.
**
** Copyright 2016 Freescale Semiconductor, Inc.
** Copyright 2016-2023 NXP
** Copyright 2016-2025 NXP
** SPDX-License-Identifier: BSD-3-Clause
**
** http: www.nxp.com
Expand All @@ -26,10 +26,14 @@
** Revisions:
** - rev. 1.0 (2021-11-16)
** Initial version.
** - rev. 2.0 (2024-10-29)
** Change the device header file from single flat file to multiple files based on peripherals,
** each peripheral with dedicated header file located in periphN folder.
**
** ###################################################################
*/


#include "system_MIMX9301_cm33.h"

/* ----------------------------------------------------------------------------
Expand All @@ -44,11 +48,11 @@ uint32_t SystemCoreClock = DEFAULT_SYSTEM_CLOCK;
void SystemInit(void)
{
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
SCB->CPACR |= ((3UL << 10 * 2) | (3UL << 11 * 2)); /* set CP10, CP11 Full Access in Secure mode */
#if defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
SCB_NS->CPACR |= ((3UL << 10 * 2) | (3UL << 11 * 2)); /* set CP10, CP11 Full Access in Non-secure mode */
#endif /* (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
#endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */
SCB->CPACR |= ((3UL << 10*2) | (3UL << 11*2)); /* set CP10, CP11 Full Access in Secure mode */
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
SCB_NS->CPACR |= ((3UL << 10*2) | (3UL << 11*2)); /* set CP10, CP11 Full Access in Non-secure mode */
#endif /* (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
#endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */

SystemInitHook();
}
Expand Down
Loading